PEP 238 (revised)

Tim Peters tim.one at home.com
Sat Jul 28 16:29:18 EDT 2001


[Tim]
> > Multiplying by 1.0 preserves the sign of a 754 zero, but adding 0.0
> > (of either sign) may not;

[Marcin 'Qrczak' Kowalczyk]
> Why adding a negative zero may not? If 0.0+(-0.0) is specified to be
> 0.0, then I don't see where it breaks.

The result of 0+(-0) is -0 in the to-minus-inf rounding mode.  The result of
multiplying by 1.0 is independent of rounding mode.

obviously-correct-is-better-than-subtly-broken-ly y'rs  - tim





More information about the Python-list mailing list