bigfloat

bearophile bearophileHUGS at lycos.com
Wed Apr 8 16:15:33 PDT 2009


Miles Wrote:
> Funny, but as a side note, currency calculation shouldn't be done with
> floats, but with *integers* (or fixed-precision numbers, that is
> ultimately equivalent to integers that represent some minimal fraction
> of the currency unit, usually cents).

Wide (or multi-precision) floating point numbers represented in base 10 is a good starting point. You want maximum safety for such operations. An example, 
http://docs.python.org/library/decimal.html

Bye,
bearophile



More information about the Digitalmars-d mailing list