Skip to content

Commit

Permalink
assert is now debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Fernández Serrata committed Apr 25, 2024
1 parent bdb54f6 commit 8fa428e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,23 @@ pub fn H(n: &BigUint, base: BigUint, exp: &BigUint) -> BigUint {
return big_pow(base, exp);
}
let n4 = n3 + &n1;
assert!(n >= &n4);
debug_assert!(n >= &n4);

if base.is_zero() {
return if (exp % 2u8).is_zero() { n1 } else { n0 };
}
if base.is_one() {
return n1;
}
assert!(base >= n2.clone());
debug_assert!(base >= n2.clone());

if exp.is_zero() {
return n1;
}
if exp.is_one() {
return base;
}
assert!(exp >= &n2);
debug_assert!(exp >= &n2);

if base == n2 && exp == &n2 {
return n4;
Expand Down

0 comments on commit 8fa428e

Please sign in to comment.