// Find the greatest common divisor of two nonnegative integral measurements using Euclid's remainder algorithm. pub fn euclid_gcd(left: i64, right: i64) -> i64 { if left<0 || right<0 { return -1; } let mut a = left; let mut b = right; while b != 0 { let rem = a%b; a = b; b = rem; } a }