Skip to main content

gcd

Function gcd 

Source
pub fn gcd(a: u64, b: u64) -> u64
Expand description

Greatest common divisor (Euclidean algorithm).

ยงExamples

use mathverse_core::integer::gcd;

assert_eq!(gcd(48, 18), 6);
assert_eq!(gcd(17, 5), 1);
assert_eq!(gcd(0, 5), 5);