royNiladri / js-big-decimal

Work with large numbers on the client side with high precision.
https://www.npmjs.com/package/js-big-decimal
MIT License
156 stars 28 forks source link

Getting imprecise result #36

Closed kevinRoomies closed 4 years ago

kevinRoomies commented 4 years ago

Describe the bug I'm getting an imprecise result after multiplying.

To Reproduce import BigDecimal from 'js-big-decimal'; console.log(BigDecimal.multiply('11612,7833519', '10.764'));

Expected behavior Result should be 125000, getting 124999.9999998516 like I get with plain js.

kevinRoomies commented 4 years ago

It appears that the first number I had was actually not precise to begin with. I don't know how I kept getting 125000 with it on other calculators but at the end there's no issue, I apologize for the false alert.