Is there a decimal math library for JavaScript?

Michael Borgwardt picture Michael Borgwardt · Apr 12, 2010 · Viewed 11.7k times · Source

Is there a mature library for doing decimal-based math, possibly arbitrary-precision, in JavaScript?

Edit: I want this information for a reference page on floating-point-related problems and alternatives to use when binary floating-point is inappropriate: http://floating-point-gui.de/

Answer

MikeM picture MikeM · Nov 9, 2012

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

For a more mature library, the ICU4J BigDecimal translation is also recommended.