mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
factor::numeric::gcd: modify divisor()
test to return correct true/false results for all possible inputs
This commit is contained in:
parent
07eaa7fe5a
commit
c33284f38b
1 changed files with 1 additions and 1 deletions
|
@ -79,7 +79,7 @@ mod tests {
|
|||
fn divisor(a: u64, b: u64) -> bool {
|
||||
// Test that gcd(a, b) divides a and b
|
||||
let g = gcd(a, b);
|
||||
(a == 0 && b == 0) || (a % g == 0 && b % g == 0)
|
||||
(g != 0 && a % g == 0 && b % g == 0) || (g == 0 && a == 0 && b == 0)
|
||||
}
|
||||
|
||||
fn commutative(a: u64, b: u64) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue