A Date With Tim Peters...

Tim Peters tim_one at email.msn.com
Tue Dec 7 00:22:10 EST 1999


[Tres Seaver]
> Heh, I recall fondly one machine where +0 and -0 were different,
> so why not?
>
> (A Cyber mainframe, ones-complement, if the faded label on the
> card deck box isn't fooling me :)
>
> A-zero-by-any-other-sign'ly,

>>> import math
>>> zero = 0.0
>>> math.atan2(zero, zero)
0.0
>>> zero = -zero
>>> math.atan2(zero, zero)
-3.14159265359
>>>

That is, IEEE-754 mandates signed zeroes too, in part so that an underflow
"remembers which direction it came from".

cdc-was-ahead-of-its-time<wink>-ly y'rs  - tim






More information about the Python-list mailing list