Does python suck or I am just stupid?

Gareth McCaughan Gareth.McCaughan at pobox.com
Sun Feb 23 12:45:39 CET 2003


Mark VandeWettering wrote:

>  Floating point math doesn't work.  It isn't just a problem with Python.

Floating point math does work. It just doesn't work the way
some people expect it to. Unfortunately, there's no way to
make computer arithmetic work exactly the way everyone expects,
because not everyone expects the same thing. It might be
possible to make it work roughly the way most people expect,
e.g. by doing exact rational arithmetic and displaying
rationals whose denominators are of the form 2**m*5**n
in decimal notation, but that approach opens up problems
of its own with efficiency. (Because a single arithmetic
operation can take an unboundedly long time, and a single
number can take up an unboundedly large amount of memory,
and it's hard to predict in advance whether that's going
to happen to you.)

-- 
Gareth McCaughan  Gareth.McCaughan at pobox.com
.sig under construc




More information about the Python-list mailing list