4 ms·
Maybe he's referring to bitcoin :) But yes, money doesn't require floating point precision. Represent it as an integer (of cents) and add the decimal in yourse
by law 15y ago
Maybe he's referring to bitcoin :)
But yes, money doesn't require floating point precision. Represent it as an integer (of cents) and add the decimal in yourself.
- mattmanser 15y agoIt's quite common to need more precision than that. Interest is a good example. Also 0.025 cents per widget. Perhaps in your world 1 cent is the minimum anything in the world can cost. The rest of us, alas, live in the real world.
- law 15y agoOP said this is for personal finance...very rarely would you need more precision than that. Also, 1 cent is the minimum that anything can cost. Do you happen to have any 1/10 cent pieces lying around? That's a financial fiction.
- viraptor 15y agoTelephony providers quite often deal with fractions of the smallest amounts. A Skype call to UK will cost you 1.4p/min for example. It's quite normal for the actual company to have per-second rate and keep it as a 1000th of a penny number. You might not have a 1/2p coin, but you can have 1/2p on your account.