Skip to main content

gcd

Function gcd 

Source
pub fn gcd(a: i64, b: i64) -> Result<i64, Error>
Expand description

Greatest common divisor.

The result is always non-negative. Returns Error::InvalidInput if the result does not fit in an i64 (this only happens for gcd(i64::MIN, 0)).