3 ms·
the reason you want to use decimal arithmetic is not so that your rounding will be more correct, but so that it will be rounded off in the same way as your bank
by kragen 4y ago
the reason you want to use decimal arithmetic is not so that your rounding will be more correct, but so that it will be rounded off in the same way as your bank and your auditors round off; it would be very unfortunate if there was a one-penny discrepancy in half of a million transactions per day, especially if for some statistical reason there's a bias in that discrepancy
- topaz0 4y agoAbsolutely there are reasons to choose to do your rounding in a particular way for a particular purpose. I was only making the point that the argument for using fixed point decimal that is laid out in the post had nothing to do with the choice of decimal and nothing to do with the choice of fixed point.
- kragen 4y agoi wasn't trying to defend the post