# @japan-d2/gcd

> compute Greatest Common Divisor (GCD)

Latest version **0.0.8** (published 2020-03-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @japan-d2/gcd
pnpm add @japan-d2/gcd
yarn add @japan-d2/gcd
bun add @japan-d2/gcd
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2020-03-07 |
| First published | 2020-02-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.4.0 |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | AOKI Yuto |
| Maintainers | tatat, uneco |
| Keywords | Math, Greatest Common Divisor, GCD |

## Links

- npm: https://www.npmjs.com/package/@japan-d2/gcd
- Repository: https://github.com/japan-d2/js-gcd
- Issues: https://github.com/japan-d2/js-gcd/issues
- npm.io page: https://npm.io/package/@japan-d2/gcd

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 0.0.8 (latest) — 2020-03-07
- 0.0.7 — 2020-02-17
- 0.0.6 — 2020-02-16
- 0.0.5 — 2020-02-15
- 0.0.4 — 2020-02-15
- 0.0.3 — 2020-02-15
- 0.0.2 — 2020-02-14
- 0.0.1 — 2020-02-14

## README

# gcd

Compute the greatest common divisor using
[Euclid's algorithm](https://en.wikipedia.org/wiki/Greatest_common_divisor#Using_Euclid.27s_algorithm).

# install

```bash
npm install @japan-d2/gcd
```

or

```bash
yarn add @japan-d2/gcd
```

# how to use

## example

```ts
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

```ts
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

---
_Source: https://npm.io/package/@japan-d2/gcd · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
