add gcd
This commit is contained in:
parent
c091a8f50a
commit
80e2ff8805
|
@ -0,0 +1,6 @@
|
||||||
|
let gcd = |mut x: i64, mut y: i64|{
|
||||||
|
while y != 0 {
|
||||||
|
(x, y) = (y, x % y);
|
||||||
|
}
|
||||||
|
x
|
||||||
|
};
|
Loading…
Reference in New Issue