3 ms·
Huh? Bitcoin uses integers. The maximum supply of BTC in satoshis fits in 64 bits. JS implementations that need to handle BTC amounts use doubles, but only by n
by fluoridation 2y ago
Huh? Bitcoin uses integers. The maximum supply of BTC in satoshis fits in 64 bits. JS implementations that need to handle BTC amounts use doubles, but only by necessity, since JS doesn't have an integer type. They still use the units to represent satoshis, which works because the maximum supply also fits in 53 bits, so effectively they're also using integers.
Anyone who uses binary floating point operations on monetary values doesn't know what they're doing and is asking for trouble.
- wbl 2y agoSo if I want to price a barrier in Bermudan rainbow via Monte Carlo I should take the speed hit for a few oddball double rounding problems that are pennies?
- fluoridation 2y agoI mean, you do you. People generally don't complain if you're a couple hundred nanoseconds (if that) late. They do complain if your accounts don't add up by a single penny.
- wbl 2y agoThe quoting of something exotic like this is not well defined to the penny. It's transactions where people really care about pennies.