UNPKG

gcd-euclidean

Version:

GCD calculation for any two given integer.

9 lines (7 loc) 125 B
function gcd(a, b) { while (b !== 0) { [a, b] = [b, a % b]; } return a; } module.exports = gcd;