@knutkirkhorn/gcd
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

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

Package Sidebar

Install

npm i @knutkirkhorn/gcd

Weekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

3.04 kB

Total Files

5

Last publish

Collaborators

  • knutkirkhorn