Why wouldn't currency by handled by the type system? You could still have an overrun. But it'd be handled more appropriately.
Long ago, I wrote a budgeting / estimating tool. Costs were represented with binary coded decimals (BCDs). Not floating point numbers. Just like an accounting system.
Competing products could have weird roundoff errors. Not mine.
For accounting, why not just use scaled integers? Isn't there a limit to many many digits you want after the period? BTW, I think BCD is outmoded. Seems it's getting replace by DPD which has far less overhead (http://en.wikipedia.org/wiki/Binary-coded_decimal#Higher-den...).
Why wouldn't currency by handled by the type system? You could still have an overrun. But it'd be handled more appropriately.
Long ago, I wrote a budgeting / estimating tool. Costs were represented with binary coded decimals (BCDs). Not floating point numbers. Just like an accounting system.
Competing products could have weird roundoff errors. Not mine.