Greatest common divisor via the Euclidean algorithm.

Symbols

  • function gcd math::gcd pub fn gcd(a: u64, b: u64) -> u64

Source

rust math/gcd.rs Repository source
1pub fn gcd(a: u64, b: u64) -> u64 {
2    if b == 0 { a } else { gcd(b, a % b) }
3}

Dependencies

Depends on

No direct dependencies.

Used by

No public library uses this one yet.

Relations

No relations declared.

Verification

Diagnostics

No diagnostics.