diff --git a/number/gcd.rs b/number/gcd.rs new file mode 100644 index 0000000..de751d2 --- /dev/null +++ b/number/gcd.rs @@ -0,0 +1,6 @@ +let gcd = |mut x: i64, mut y: i64|{ + while y != 0 { + (x, y) = (y, x % y); + } + x +}; \ No newline at end of file