mikemcl/bignumber.js

A JavaScript library for arbitrary-precision decimal and non-decimal arithmetic

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 47 minutes ago
Added to GitGenius on September 9th, 2026
Created on November 8th, 2012
Open Issues & Pull Requests: 8 (+0)
GitHub issues: Enabled
Number of forks: 752
Total Stargazers: 7,010 (+0)
Total Subscribers: 79 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 26.0 hours
Mean response time: 176.7 days
90th percentile: 708.4 days
Tracked items: 40

How this project is maintained

Around half of the issues opened in the past year never receive a reply. Only 8% of issues opened in the past year have been closed. Three people close 100% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 2
New in 7 days: 1
Closed in 7 days: 0
Avg open age: 15 days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 1
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Detailed Description

bignumber.js is a JavaScript library for arbitrary-precision decimal and non-decimal arithmetic.

The library solves the problem of precision loss when performing calculations with numbers in JavaScript, where the native Number type has inherent limitations. It provides a BigNumber constructor that accepts values as numbers, strings, BigInts, or other BigNumber instances, allowing developers to work with integers and decimals of arbitrary precision. The library replicates familiar methods from JavaScript's Number type such as toExponential, toFixed, and toPrecision, while adding specialized methods like toFraction and a correctly-rounded squareRoot function. It supports multiple number bases from 2 to 36 and includes cryptographically-secure pseudo-random number generation.

Developers should choose this library when precision is critical and native JavaScript numbers are insufficient. It suits financial calculations, scientific computing, and any application requiring exact decimal arithmetic. The library is compact at 8 KB minified and gzipped with no external dependencies, making it suitable for browser and Node.js environments. The README identifies two related alternatives: big.js, which is smaller and simpler but handles only decimal numbers with fewer methods and configuration options, and decimal.js, which adds support for non-integer powers and performs operations to a specified number of significant digits.

The project maintains responsive engagement with its community, with maintainers typically responding to new issues and pull requests within a few days.