We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
overflowing_shr
Version 1.10.1
Description
uint/src/bits.rs
Lines 376 to 381 in 666cd31
The overflow result of overflowing_shr is incorrect.
The above can be modified as follows:
// Check for overflow let mut overflow = false; for i in 0..limbs { overflow |= self.limbs[i] != 0; } overflow |= self.limbs[limbs] << (64 - bits) != 0;
I tried this code:
let mut test_slice = [40u64]; let a = Uint::<64, 1>::from_limbs(test_slice); println!("{:?}", a.overflowing_shr(1)); test_slice[0] = 41u64; let b = Uint::<64, 1>::from_limbs(test_slice); println!("{:?}", b.overflowing_shr(1));
I expected to see this happen:
(0x0000000000000014_U64, false) (0x0000000000000014_U64, true)
Instead, this happened:
(0x0000000000000014_U64, true) (0x0000000000000014_U64, true)
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Version
1.10.1
Description
uint/src/bits.rs
Lines 376 to 381 in 666cd31
The overflow result of
overflowing_shr
is incorrect.The above can be modified as follows:
I tried this code:
I expected to see this happen:
Instead, this happened:
The text was updated successfully, but these errors were encountered: