Closed LightTemplar closed 1 year ago
37.8+2.9
I think all math in the calculator should be implemented using a BigDecimal type, because Javascript's limited floating point math (IEEE-754) has this surprises, some numbers that can't be accurately represented. Same happened in Java, they included BigDecimal for arbitrary precission. An example library in JS that does the same: https://github.com/iriscouch/bigdecimal.js
The package seems to do two things:
We han handle both things:
I include sample index.js for math package that seems to work (renamed to index.js.txt so that it's accepted here).
Give me permissions (if you feel like) for creating a branch and doing a PR. Kind regards!
Thanks @manolinux! Can you fork the repo, create a branch and then do a pull request? This is the way to contribute to presearch-packages repo
Closing this one because it has been fixed by @manolinux. It will be pushed to production soon, thanks guys!
Describe the bug Enter 37.8+2.9 in the search field, calculator gives: = 40.699999999999996
Expected behavior The result should be: 40.7
Screenshots
Desktop (please complete the following information):
Additional context Nothing more