(2**64 - 1) * 2**64 + 2**64 == 1
huonw opened this issue · 2 comments
huonw commented
This test fails:
#[test]
fn foo() {
let mut ar = ((Int::from(1) << 64) - 1) << 64_usize;
let br = Int::from(1) << 64;
assert_eq!(ar + br, Int::from(1) << 128);
}
(I'm debugging it now.)
Aatch commented
That is some edge case there. I'm guessing it's something to do with the shift-left implementation.