3 ms·
Yes... It's an artifact of floating points. My issue is that JS only has floating points and not Ints and Decimal.
by noveltyaccount 5y ago
Yes... It's an artifact of floating points. My issue is that JS only has floating points and not Ints and Decimal.
- hajile 5y agoJS has had integers since pretty much day 1 with bitwise operators. They just (from a user perspective) convert back afterward. If you were choosing just one though, floats would definitely be a better choice than integers. It's also possible to make length 1 typed arrays of integers and operate on them if you really need. Then, as you mention there's BigInt numbers which are supported on the last few versions of every major browser except IE11.
- runarberg 5y agoThere is a stage 1 proposal for BigDecimal. https://github.com/tc39/proposal-decimal https://github.com/tc39/proposal-decimal