8000 fix: gt_u64_max by DaniPopes · Pull Request #480 · recmo/uint · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: gt_u64_max #480

New issue

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

Merged
merged 1 commit into from
May 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions proptest-regressions/pow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
# everyone who runs the test benefits from these saved cases.
cc 6094eff41642fcafe6b3f005cb37be0a1325663279a398d9a322b9713e31dfaf # shrinks to b = 2, e = 0
cc 91ec14a644e5bb122d26bff9b283ec81f2410e2ce2c0650263bef622c45c0b82 # shrinks to e = 1
cc 59c1c81a16f5f196bcc05ffd83cc3cfa6f16e281bac0e0c058b25b2fc8e87792 # shrinks to e = 0
2 changes: 1 addition & 1 deletion src/bits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl<const BITS: usize, const LIMBS: usize> Uint<BITS, LIMBS> {

/// Returns the number of significant words (limbs) in the integer.
///
/// If this is 0, then `limbs[1..]` are all non-zero.
/// If this is 0, then `self` is zero.
#[inline]
pub(crate) const fn count_significant_words(&self) -> usize {
let mut i = LIMBS;
Expand Down
2 changes: 1 addition & 1 deletion src/from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ impl<const BITS: usize, const LIMBS: usize> Uint<BITS, LIMBS> {
.fold(0u64, core::ops::BitOr::bitor)
!= 0
} else {
self.count_significant_words() == 0
self.bit_len() > 64
}
}
}
Expand Down
0