3 ms·
I wonder the same. The readme says: "The / operator also work as expected with whole numbers. However, since these are BigInts and not BigDecimals, this operat
by Aardwolf 8y ago
I wonder the same. The readme says:
"The / operator also work as expected with whole numbers. However, since these are BigInts and not BigDecimals, this operation will round towards 0, which is to say, it will not return any fractional digits."
What BigDecimal are they referring to? I don't find any tc39 big decimals, only third party libraries
- thomasfoster96 8y agoThere isn’t a BigDecimal proposal anywhere, the authors are just making it clear that their proposal is limited to integers.
- qwerty456127 8y ago> There isn’t a BigDecimal proposal anywhere Why? I find it so weird there still is no BigDecimal in JavaScript.
- JeremyBanks 8y agoIt is relative common for software to need integers larger than 53 bits. It seems quite uncommon for software to require Decimal arithmetic. Do you have a motivating example?
- qwerty456127 8y agoAnything that deals with money. Every e-commerce or fintech app.
- thomasfoster96 8y agoI actually didn’t look hard enough: there is a proposal[0] for something that could be called ‘BigDecimal’ in ECMAScript, but it’s a stage 0 proposal[1]. As for why a decimal type hasn’t progressed further in ECMAScript you’ll want to read the notes [2] from the meeting where the latest proposal was discussed. [0] https://docs.google.com/presentation/d/1jPsw7EGsS6BW59_BDRu9o0o3UwSXQeUhi38QG55ZoPI/edit?pli=1 https://docs.google.com/presentation/d/1jPsw7EGsS6BW59_BDRu9... [1] https://github.com/tc39/proposals/blob/master/stage-0-proposals.md https://github.com/tc39/proposals/blob/master/stage-0-propos... [2] https://github.com/rwaldron/tc39-notes/blob/b8da60318b564f136cbe8385f17f42abc0666cdd/es8/2017-11/nov-29.md#9ivb-decimal-for-stage-0 https://github.com/rwaldron/tc39-notes/blob/b8da60318b564f13...