21 ms·
I'd qualify the statement a bit and say, don't use floats for accounting. It's a tradition that the last column of an accounting calculation is a kind of crude
by analog31 7y ago
I'd qualify the statement a bit and say, don't use floats for accounting. It's a tradition that the last column of an accounting calculation is a kind of crude error checking code.
I think if you're doing financial modeling, or anything where the real uncertainty is bigger than your unit of money, then it's like any other calculation -- use floats with all of the cautions that you learned in numerical analysis class.
My dad played the stock market and used a slide rule for his calculations.
Another reminiscence: Since he owned some stocks, my dad got annual reports. I remember leafing through the report from General Motors, and seeing that all of the numbers were given at full precision, down to the penny. I remember thinking to myself: If one worker accidentally carries a pencil home, those numbers are all wrong!