mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-14 19:16:17 +00:00
Merge pull request #5995 from cakebaker/factor_enable_debug_assert
factor: enable a debug_assert! statement
This commit is contained in:
commit
f7821cd0d2
1 changed files with 5 additions and 8 deletions
|
@ -31,14 +31,11 @@ pub(crate) trait Arithmetic: Copy + Sized {
|
|||
|
||||
// Check that r (reduced back to the usual representation) equals
|
||||
// a^b % n, unless the latter computation overflows
|
||||
// Temporarily commented-out, as there u64::checked_pow is not available
|
||||
// on the minimum supported Rust version, nor is an appropriate method
|
||||
// for compiling the check conditionally.
|
||||
//debug_assert!(self
|
||||
// .to_u64(_a)
|
||||
// .checked_pow(_b as u32)
|
||||
// .map(|r| r % self.modulus() == self.to_u64(result))
|
||||
// .unwrap_or(true));
|
||||
debug_assert!(self
|
||||
.to_u64(_a)
|
||||
.checked_pow(_b as u32)
|
||||
.map(|r| r % self.modulus() == self.to_u64(result))
|
||||
.unwrap_or(true));
|
||||
|
||||
result
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue