pub fn gcd<T>(a: T, b: T) -> TExpand 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);