Skip to content

Commit 60b185d

Browse files
re-formate GetGCD with standard.js
1 parent 10373dd commit 60b185d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Maths/GetGCD.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
* @returns return a `gcd` value of both number.
1313
*/
1414
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-
}
15+
// Find a minimum of both numbers.
2216

23-
return (less)
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+
}
22+
23+
return (less)
2424
}
2525

2626
module.exports = getGcd

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy