Skip to content

🔢 Get the greatest common devisor of two numbers

License

Notifications You must be signed in to change notification settings

knutkirkhorn/gcd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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