factor::numeric::gcd: Exclude the 0 case from test divisor

This commit is contained in:
nicoo
2020-09-03 14:56:10 -05:00
committed by Roy Ivy III
parent 19e967ef31
commit c11cebc4d3
+1 -2
View File
@@ -75,8 +75,7 @@ mod tests {
fn divisor(a: u64, b: u64) -> bool {
// Test that gcd(a, b) divides a and b
let g = gcd(a, b);
if g == 0 { return a == 0 && b == 0; }
a % g == 0 && b % g == 0
(a == 0 && b == 0) || (a % g == 0 && b % g == 0)
}
fn commutative(a: u64, b: u64) -> bool {