UNPKG
@japan-d2/gcd
Version:
latest (0.0.8)
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
compute Greatest Common Divisor (GCD)
github.com/japan-d2/js-gcd
japan-d2/js-gcd
@japan-d2/gcd
/
lib
/
index.js
10 lines
(9 loc)
•
192 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
"use strict"
;
Object
.
defineProperty
(
exports
,
"__esModule"
, {
value
:
true
});
function
gcd
(
a, b
) {
if
(b ===
0
) {
return
a; }
return
gcd
(b, a % b); }
exports
.
default
= gcd;