euler/rust/src/euler/math.rs

8 lines
129 B
Rust
Raw Normal View History

2019-10-07 05:43:22 +00:00
pub fn gcd(mut a: u64, mut b: u64) -> u64 {
while b != 0 {
let t = a;
a = b;
b = t % b;
}
a
}