This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 400,000 packages pre-installed, including
gcd with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
Compute the greatest common divisor using Euclid's algorithm.
var gcd = require('gcd'); var n = gcd(121,44); console.log(n);
var gcd = require('gcd')
Return the greatest common divisor of the integers
b using Euclid's
With npm do:
npm install gcd