1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 20:17:45 +00:00

factor::numeric::gcd: Add explicit test for the 0 case

This commit is contained in:
nicoo 2020-08-19 10:25:39 +02:00 committed by Roy Ivy III
parent c11cebc4d3
commit 07eaa7fe5a

View file

@ -72,6 +72,10 @@ mod tests {
gcd(1, a) == 1
}
fn zero(a: u64) -> bool {
gcd(0, a) == a
}
fn divisor(a: u64, b: u64) -> bool {
// Test that gcd(a, b) divides a and b
let g = gcd(a, b);