gcd

Function gcd 

Source
pub fn gcd<T>(a: T, b: T) -> T
where T: Copy + Rem<Output = T> + PartialEq + Zero,
Expand description

Greatest common divisor. Behaviour when calling with negative numbers can be unintuitive; refer to examples below.

assert_eq!(aoclib_rs::gcd(8, 12), 4);
assert_eq!(aoclib_rs::gcd(-8, -12), -4);
assert_eq!(aoclib_rs::gcd(-8, 12), 4);
assert_eq!(aoclib_rs::gcd(8, -12), -4);