Signed carry carrying_add in bigint_helper_methods · Issue #90541 · rust-lang/rust (original) (raw)
I had this question on the currently unreleased #![feature(bigint_helper_methods)]
#85532; on signed carry (probably applies to substraction too ?); I have this test failing with the current code:
assert_eq!(i8::MAX.carrying_add(i8::MIN, true), (0, false));
Playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=a161cf42872e087303d1435648e6eceb
Is the test correct ? A carry did happen in an intermediate calculation, but should the overall calculation report a carry ?