2 ms·
Floating point cannot represent money. It shouldn't. But you would be amazed how much bad code there is out there. A lot of it just uses floating point arith
by btilly 16y ago
Floating point cannot represent money.
It shouldn't. But you would be amazed how much bad code there is out there. A lot of it just uses floating point arithmetic because it is easy. (Actually for Monte Carlo simulations it isn't even a bad idea. There speed matters over precision.)
(Furthermore you get fun issues when you add in the complication of having multiple currencies that vary against each other.)