mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 20:47:46 +00:00
factor::numeric::gcd: Add explicit test for the 0 case
This commit is contained in:
parent
c11cebc4d3
commit
07eaa7fe5a
1 changed files with 4 additions and 0 deletions
|
@ -72,6 +72,10 @@ mod tests {
|
||||||
gcd(1, a) == 1
|
gcd(1, a) == 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn zero(a: u64) -> bool {
|
||||||
|
gcd(0, a) == a
|
||||||
|
}
|
||||||
|
|
||||||
fn divisor(a: u64, b: u64) -> bool {
|
fn divisor(a: u64, b: u64) -> bool {
|
||||||
// Test that gcd(a, b) divides a and b
|
// Test that gcd(a, b) divides a and b
|
||||||
let g = gcd(a, b);
|
let g = gcd(a, b);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue