Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

gcd

substack151.9kMIT0.0.1

compute the greatest common divisor using euclid's algorithm

gcd, divisor, math, maths, mathematics, euclid

readme

gcd

Compute the greatest common divisor using Euclid's algorithm.

testling badge

build status

example

var gcd = require('gcd');
var n = gcd(121,44);
console.log(n);

11

methods

var gcd = require('gcd')

gcd(a, b)

Return the greatest common divisor of the integers a and b using Euclid's algorithm.

install

With npm do:

npm install gcd

license

MIT