3 ms·
How do you handle things like multiplying by some interest rate of 3.125 or (1 + 0.03125)^-354 as examples. Sure you can round at the end but then you have to
by patrickthebold 7y ago
How do you handle things like multiplying by some interest rate of 3.125 or (1 + 0.03125)^-354 as examples.
Sure you can round at the end but then you have to worry about compounding errors.
- anoonmoose 7y agoI think that's just part of the process of deciding how small an increment each integer represents (dollars, cents, centi-cents, milli-cents).
- elcritch 7y agoAccounting rules often care more about consistency than precision per se. As long as the code follows accepted accounting rules (say bankers rounding) choosing a known precision works. Often GAAP and other standards don’t define all details for, say amortization, but if you use a scheme the code should always use that method.