float equality

Kagamin spam at here.lot
Tue Feb 22 00:51:44 PST 2011


bearophile Wrote:

> Andrei Alexandrescu:
> 
> > This is a long-standing myth. I worked on Wall Street and have friends 
> > who have been doing it for years. Everybody uses double.
> 
> Unbrutal Python programmers are encouraged to avoid the float type to manage money values, and use decimal instead:
> http://docs.python.org/library/decimal.html

Interesting question is whether 5e-17 is a big error.
If I want to divide a dollar into 3 parts, should it be 33 cents or 33.333333...? A possible error here is 1%.


More information about the Digitalmars-d mailing list