Why isn't Python king of the hill?

Grant Edwards grante at visi.com
Sat Jun 2 17:49:06 CEST 2001


On Sat, 2 Jun 2001 09:42:34 +0200, Alex Martelli <aleaxit at yahoo.com> wrote:

>> _never_ expect an exact result and not to use binary floating
>> point if you require an exact result.
>>
>> You may thing that 1.0 + 2.0 == 3.0 ought to be true, but you
>
>And it is (on any FP system respecting IEEE 754 -- and any
>other FP system I've ever heard about).

I know that it is.  But when you start depending on that fact,
you're doomed.

>> should always treat floating point operations as if there are
>> small random numbers being thrown in at every step.  So you
>
>I think this is exactly what Kahan describes as one of the
>widespread (and false) myths about floating point.

Of course it is not true.  But if you pretend it is, you've got
a much better chance of producing working code.

-- 
Grant Edwards                   grante             Yow!  And furthermore,
                                  at               my bowling average is
                               visi.com            unimpeachable!!!



More information about the Python-list mailing list