3 ms·
Precision / rounding requirements is often the reason for this. E.g. last time I implemented VAT rounding on a billing system (no I'm not suggesting I'd use tr
by vidarh 9y ago
Precision / rounding requirements is often the reason for this.
E.g. last time I implemented VAT rounding on a billing system (no I'm not suggesting I'd use trig functions for that; it's just an example of why precision matters) our financial controller was hovering over me with a copy of the HMRC rules for VAT rounding, and while we certainly could do it with floats or binary fixed point if we took some care, doing it with decimal fixed points made it a lot easier to demonstrate to our financial controller that I wasn't doing anything that'd make him liable for tax evasion.
Different representations works best for different things, but you better understand the tradeoffs.