[][src]Function reikna::factor::gcd

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

Find the GCD of a and b using the Euclidean algorithm.

This function will return 0 if both arguments are zero.

Examples

use reikna::factor::gcd;
assert_eq!(gcd(76, 54), 2);
assert_eq!(gcd(18, 24), 6);
assert_eq!(gcd(5, 2), 1);