You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letmut x:BigInt = 0.into();let y:isize = -1;
x += y;assert_eq!(BigInt::from(-1), x);// fails// x is actually 2^64-1
x + y gives the proper result (-1), and if y is i32 or i64 it works as expected, but isize somehow breaks things. When compiled for 64-bit the result is off by 2^64, and for 32-bit it is off by 2^32.
The text was updated successfully, but these errors were encountered:
x + y
gives the proper result (-1
), and ify
isi32
ori64
it works as expected, butisize
somehow breaks things. When compiled for 64-bit the result is off by 2^64, and for 32-bit it is off by 2^32.The text was updated successfully, but these errors were encountered: