number-calc
Calculate addition, subtraction, multiplication, and division precisely using JS
Why
01 + 02 = 03000000000000000410 - 09 = 00999999999999999811 * 11 = 12100000000000002121 / 11 = 10999999999999999
Install
npm install --save number-calc
Methods
NC // addition, number1 + number2NC // subtraction, number1 - number2NC // multiplication, number1 * number2NC // division, number1 / number2NC // prune, precision defaults to 12
Usage
NC // 0.3, not 0.30000000000000004NC // 0.1, not 0.09999999999999998NC // 1.21, not 1.2100000000000002NC // 1.1, not 1.0999999999999999NC // 0.3
License
MIT