We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 10373dd commit 60b185dCopy full SHA for 60b185d
1 file changed
Maths/GetGCD.js
@@ -12,15 +12,15 @@
12
* @returns return a `gcd` value of both number.
13
*/
14
const getGcd = (arg1, arg2) => {
15
- // Find a minimum of both numbers.
16
-
17
- let less = arg1 > arg2 ? arg2 : arg1
18
- // Iterate the number and find the gcd of the number using the above explanation.
19
- for (less; less >= 2; less--) {
20
- if ((arg1 % less === 0) && (arg2 % less === 0)) return (less)
21
- }
+ // Find a minimum of both numbers.
22
23
- return (less)
+ let less = arg1 > arg2 ? arg2 : arg1
+ // Iterate the number and find the gcd of the number using the above explanation.
+ for (less; less >= 2; less--) {
+ if ((arg1 % less === 0) && (arg2 % less === 0)) return (less)
+ }
+
+ return (less)
24
}
25
26
module.exports = getGcd
0 commit comments