# big-number

> Light, ultra-fast javascript implementation for BigIntegers (base arithmetic operations)

Latest version **2.0.0** (published 2018-12-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install big-number
pnpm add big-number
yarn add big-number
bun add big-number
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-12-11 |
| First published | 2012-11-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 32 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 64 |
| Author | Alex Bardas |
| Maintainers | alexbardas |
| Keywords | number, big, int, integer, bigint, big integer, bignumber, big-number, bignumbers, arithmetic, operations |

## Links

- npm: https://www.npmjs.com/package/big-number
- Repository: https://github.com/alexbardas/bignumber.js
- Homepage: https://github.com/alexbardas/bignumber.js#readme
- Issues: https://github.com/alexbardas/bignumber.js/issues
- npm.io page: https://npm.io/package/big-number

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2018-12-11
- 1.0.0 — 2018-06-14
- 0.4.0 — 2016-02-21
- 0.3.2 — 2016-02-12
- 0.3.1 — 2014-08-03
- 0.3.0 — 2014-07-11
- 0.2.5 — 2012-11-03

## README

## BigNumber.js

[![Build Status](https://secure.travis-ci.org/alexbardas/bignumber.js.png)](http://travis-ci.org/alexbardas/bignumber.js)

BigNumber.js is a light javascript library for node.js and the browser. It supports arithmetic operations on Big Integers.

It is build with performance in mind, uses the fastest algorithms and supports all basic arithmetic operations
(+, -, *, /, %, ^, abs). Works with both positive and negative big integers.

: (http://alexbardas.github.io/bignumber.js/)

Install:
npm install

Test:
npm test

Usage:

* in node:
```javascript
	var BigNumber = require('big-number');

    BigNumber(5).plus(97).minus(53).plus(434).multiply(5435423).add(321453).multiply(21).div(2).pow(2);
    // 760056543044267246001
```

* in the browser:
```javascript
	<script src ="big-number.js"></script>

    n(5).plus(97).minus(53).plus(434).multiply(5435423).add(321453).multiply(21).div(2).pow(2);
    // 760056543044267246001
```

### API

Supported methods: `add/plus`, `minus/subtract`, `multiply/mult`, `divide/div`, `power/pow`, `mod`, `equals`,
`lt`, `lte`, `gt`, `gte`, `isZero`, `abs`

###### Addition
```javascript
	BigNumber(2).plus(10); // or
	BigNumber(2).add(10);
```

###### Subtraction
```javascript
	BigNumber(2).minus(10); // or
	BigNumber(2).subtract(10);
```

###### Multiplication
```javascript
	BigNumber(2).multiply(10); // or
	BigNumber(2).mult(10);
```

###### Division
```javascript
	BigNumber(2).divide(10); // or
	BigNumber(2).div(10);
```

###### Modulo
```javascript
	BigNumber(53).mod(14);
```

###### Power
```javascript
	BigNumber(2).power(10); // or
	BigNumber(2).pow(10);
```

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