Against PEP 240

Bengt Richter bokr at accessone.com
Fri Jun 1 13:05:08 EDT 2001


On 31 May 2001 16:52:46 -0700, aahz at panix.com (Aahz Maruch) wrote:

>In article <3b16a5e2.10711472 at wa.news.verio.net>,
>Bengt Richter <bokr at accessone.com> wrote:
>>
>>Note the following "recovery" of exactness, assuming the result has
>>two legitimate decimals ;-)
>>
>> >>> 0.98
>> 0.97999999999999998
>> >>> "%4.2f" % (.98,)
>> '0.98'
>
>That's what Python used to do.  Problem is, error propagates rapidly,
>especially with multiplication, division, and addition/subtraction of
>numbers with differing magnitude.

Well, I was talking about using an error-correcting-code (ECC) concept
to prevent propagation of errors, not just finessing the final output.
I guess my tail end example was misleading 8-<:^)





More information about the Python-list mailing list