We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e19b6a3 commit 82e8e68Copy full SHA for 82e8e68
src/internal_math.rs
@@ -60,7 +60,7 @@ impl Barrett {
60
let x = (((z as u128) * (self.im as u128)) >> 64) as u64;
61
let mut v = (z - x * self._m as u64) as u32;
62
if self._m <= v {
63
- v += self._m;
+ v.wrapping_add(self._m);
64
}
65
v
66
@@ -109,7 +109,7 @@ fn is_prime_constexpr(n: i32) -> bool {
109
while d % 2 == 0 {
110
d /= 2;
111
112
- for a in [2, 7, 61].iter().copied() {
+ for &a in &[2, 7, 61] {
113
let mut t = d;
114
let mut y = pow_mod_constexpr(a, t, n as i32);
115
while t != n - 1 && y != 1 && y != n - 1 {
0 commit comments