Skip to content

Commit b284f6d

Browse files
Update src/internal_math.rs
Thanks @koba-e964 Co-authored-by: Hiroki Kobayashi <[email protected]>
1 parent 5fba679 commit b284f6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/internal_math.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl Barrett {
6161
let mut z = a as u64;
6262
z *= b as u64;
6363
let x = (((z as u128) * (self.im as u128)) >> 64) as u64;
64-
let mut v = (z - x * self._m as u64) as u32;
64+
let mut v = z.wrapping_sub(x.wrapping_mul(self._m as u64)) as u32;
6565
if self._m <= v {
6666
v = v.wrapping_add(self._m);
6767
}

0 commit comments

Comments
 (0)