# node-biginteger

> BigInteger

Latest version **0.0.10** (published 2015-11-05) · 0 weekly downloads

## Install

```sh
npm install node-biginteger
pnpm add node-biginteger
yarn add node-biginteger
bun add node-biginteger
```

## 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.10 |
| Published | 2015-11-05 |
| First published | 2014-04-24 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | 汤尧 |
| Maintainers | coolme200 |
| Keywords | BigInteger |

## Links

- npm: https://www.npmjs.com/package/node-biginteger
- Repository: https://github.com/node-modules/node-biginteger
- Issues: https://github.com/node-modules/node-biginteger/issues
- npm.io page: https://npm.io/package/node-biginteger

## Dependencies (2)

- [long](https://npm.io/package/long.md) ~2.1.0
- [clone](https://npm.io/package/clone.md) ~0.2.0

## 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.10 (latest) — 2015-11-05
- 0.0.9 — 2015-05-29
- 0.0.7 — 2015-01-05
- 0.0.6 — 2014-05-24
- 0.0.5 — 2014-05-24
- 0.0.4 — 2014-05-23
- 0.0.3 — 2014-05-23
- 0.0.2 — 2014-04-24
- 0.0.1 — 2014-04-24

## README

node-biginteger
======

This library is based on [java.math.BigInteger](http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html)
Dependency [Long](https://github.com/dcodeIO/Long.js.git)

example
======

```
  $ npm install node-biginteger

  var BigInteger = require('node-biginteger');
  var n = BigInteger.fromString('abc', 16);
  n.toString(16);
  
```

Class Method: BigInteger.fromLong(val)
------
- val Long
- Return: BigInteger

Class Method: BigInteger.fromString(val, [radix])
------
- val String
- radix int,Optional, Default: 10
- Return: BigInteger

Class Method: BigInteger.fromBuffer(signum, magnitude)
------
- signum int, 1,0,-1
- magnitude Array
- Return: BigInteger

n.toBuffer()
------
- Return: Buffer

n.toString()
------
- Return: String

n.abs()
------
- Return: BigInteger

n.negate()
------
- Return: BigInteger

n.longValue()
------
- Return: Long

n.add(val)
------
- val BigInteger
- Return: BigInteger

n.subtract(val)
------
- val BigInteger
- Return: BigInteger

n.multiply(val)
------
- val BigInteger
- Return: BigInteger

n.and(val)
------
- val BigInteger
- Return: BigInteger

n.andNot(val)
------
- val BigInteger
- Return: BigInteger

n.not()
------
- Return: BigInteger

n.pow(exponent)
------
- exponent int
- Return: BigInteger

```
  var n = BigInteger.fromString('2', 10);
  var n1 = n.pow(2);
  console.log(n1.toString());
  // 4
```

n.divide(val)
------
- val BigInteger
- Return: BigInteger 

n.remainder(val)
- val BigInteger
- Return: BigInteger

Benchmark
------
```
$ node beanchmark.js

  BigInteger#multiply x 68,912 ops/sec ±0.50% (100 runs sampled)
  bignum#mul x 40,709 ops/sec ±1.30% (90 runs sampled)
  BigInteger#modPow(long) x 79.62 ops/sec ±0.98% (71 runs sampled)
  bignum#powm(long) x 22,901 ops/sec ±2.43% (92 runs sampled)
  BigInteger#modPow(short) x 134,965 ops/sec ±1.19% (97 runs sampled)
  bignum#powm(short) x 55,922 ops/sec ±2.84% (91 runs sampled)
```

## License
MIT

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