3 ms·
> I think that if anyone ever needs to give me 12 quadrillion dollars (more than a billion dollars for every human alive), they can keep the extra 21 dollars.
by throwaway613834 9y ago
> I think that if anyone ever needs to give me 12 quadrillion dollars (more than a billion dollars for every human alive), they can keep the extra 21 dollars.
You're missing the point. You don't need a 1-cent error for a smaller error to throw things off. Say someone owes you $0.30 and pays you $0.10 and $0.20. If the data type inherently has 2 digits past the decimal, or if you just do everything with integers, then they'll be debt-free by the end and nothing will go wrong. But if you're representing these with binary floats, then you have to remember to explicitly do rounding at precisely the correct intermediate spots in order to avoid incorrectly listing them as still having a balance. Even for a programmer it's too easy to either put it or forget to put it in the correct spot, let alone for a non-programmer writing the sheet.
And that's just one example. I'm sure there are tons more I can't think of off the top of my head. It's not like people made the decimal data types for nothing.