Skip to content Skip to sidebar Skip to footer

Javascript Large Number Library?

Is there a library available in javascript to handle large numbers with accuracy (sort of like what oracle does by storing the number as a string) and allows for operations like ad

Solution 1:

As its author, I recommend big.js, 'a small, fast Javascript library for arbitrary-precision arithmetic with decimal numbers'.

Solution 2:

There's a few BigInt implementations out there, for example:

Layering fixed-point conversion on top of one of them should be pretty easy.

There is also a new decimal type in some implementations, based on a new definition from IEEE 754r — I believe it was part of the (now abandoned) ECMAScript 4 spec, and is carried forward by ECMAScript 3.1/5 and JavaScript 1.9, but I could be wrong on this point.

Post a Comment for "Javascript Large Number Library?"