pub fn gcd<T>(a: T, b: T) -> T
Expand description
Compute the greatest common divisor.
The greatest common divisor is defined as largest positive integer (among a set of integers that are not all zero) that divides each of the integers.
Computes the greatest common divisor using the Euclidean algorithm.
§Example
assert_eq!(util::gcd(48, 18), 6);
assert_eq!(util::gcd(18, 48), 6);