pub const fn gcd(left: u64, right: u64) -> u64Expand description
Computes the greatest common divisor of two unsigned integers.
This helper uses the Euclidean algorithm and keeps the required edge cases
explicit: gcd(0, 0) == 0 and gcd(a, 0) == a.
ยงExamples
use use_arithmetic::gcd;
assert_eq!(gcd(54, 24), 6);
assert_eq!(gcd(0, 0), 0);
assert_eq!(gcd(21, 0), 21);