Socket
Socket
Sign inDemoInstall

big-number

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

big-number

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


Version published
Weekly downloads
77K
decreased by-3.32%
Maintainers
1
Weekly downloads
 
Created
Source

BigNumber.js

Build Status

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:
	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:
	<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
	BigNumber(2).plus(10); // or
	BigNumber(2).add(10);
Subtraction
	BigNumber(2).minus(10); // or
	BigNumber(2).subtract(10);
Multiplication
	BigNumber(2).multiply(10); // or
	BigNumber(2).mult(10);
Division
	BigNumber(2).divide(10); // or
	BigNumber(2).div(10);
Modulo
	BigNumber(53).mod(14);
Power
	BigNumber(2).power(10); // or
	BigNumber(2).pow(10);

Keywords

FAQs

Package last updated on 11 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc