Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 555 Bytes

README.md

File metadata and controls

29 lines (18 loc) · 555 Bytes

gcd

Get the greatest common devisor of two numbers

Installation

npm install @knutkirkhorn/gcd

Usage

import gcd from '@knutkirkhorn/gcd';

console.log(gcd(28, 2));
// => 2

API

gcd(number1, number2)

Returns the gcd of number1 and number2. The gcd is computed using the Euclidean algorithm.

Related