Skip to main content

gcd

Function gcd 

Source
pub fn gcd(a: usize, b: usize) -> usize
Expand description

The greatest common divisor of a and b (Euclid’s algorithm; gcd(a, 0) = a).

§Examples

use comnum_math::gcd;
assert_eq!(gcd(255, 11), 1);
assert_eq!(gcd(0, 7), 7);