We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce7e7e2 commit fdda80fCopy full SHA for fdda80f
Maths/EulersTotientFunction.js
@@ -11,9 +11,9 @@
11
const gcdOfTwoNumbers = (x, y) => {
12
// x is smaller than y
13
// let gcd of x and y is gcdXY
14
- // so it devides x and y completely
15
- // so gcdXY should also devides y%x (y = gcdXY*a and x = gcdXY*b and y%x = y - x*k so y%x = gcdXY(a - b*k))
16
- // and gcd(x,y) is equals to gcd(y%x , x)
+ // so it divides x and y completely
+ // so gcdXY should also divide y%x (y = gcdXY*a and x = gcdXY*b and y%x = y - x*k so y%x = gcdXY(a - b*k))
+ // and gcd(x,y) is equal to gcd(y%x , x)
17
return x === 0 ? y : gcdOfTwoNumbers(y % x, x)
18
}
19
0 commit comments