Money type

H. S. Teoh hsteoh at
Thu Jan 2 17:59:40 UTC 2020

On Thu, Jan 02, 2020 at 05:18:04PM +0000, Russel Winder via Digitalmars-d wrote:
> As I understand it the core problem is needing base 10 numbers not
> base 2 ones – converting between them causes problems – and using
> hardware floating point does not have enough accuracy for compliance
> with requirements of FCA for financial calculations.

AFAIK, the crux of the problem with using binary floating point types
for money representation is that the former's base-2 rounding behaviour
does not 100% match the latter's expected base-10 rounding behaviour.
This discrepancy is a big problem because in financial applications 100%
identical behaviour with base-10 rounding is a non-negotiable


Having a smoking section in a restaurant is like having a peeing section in a swimming pool. -- Edward Burr 

More information about the Digitalmars-d mailing list