0.0.8 • Published 4 years ago

@japan-d2/gcd v0.0.8

Weekly downloads
8
License
MIT
Repository
github
Last release
4 years ago

gcd

Compute the greatest common divisor using Euclid's algorithm.

install

npm install @japan-d2/gcd

or

yarn add @japan-d2/gcd

how to use

example

import gcd from '@japan-d2/gcd'
console.log(gcd(721, 161))

Output

7

methods

gcd(a: number, b: number): number

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

BigInt support

example

import gcd from '@japan-d2/gcd/lib/bigint'
console.log(gcd(721n, 161n))

Output

7n

methods

gcd(a: bigint, b: bigint): bigint

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

license

MIT

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago