A Date With Tim Peters...
Rob W. W. Hooft
rob at hooft.net
Tue Dec 7 08:08:59 EST 1999
>>>>> "TP" == Tim Peters <tim_one at email.msn.com> writes:
>>>>> [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 :)
TP>>> import math
TP>>> zero = 0.0
TP>>> math.atan2(zero, zero)
TP> 0.0
TP>>> zero = -zero
TP>>> math.atan2(zero, zero)
TP> -3.14159265359
TP> That is, IEEE-754 mandates signed zeroes too, in part so that an
TP> underflow "remembers which direction it came from".
Python 1.5.2b1 (#4, Jan 14 1999, 12:05:48) [GCC egcs-2.90.21 971202 (egc on irix5
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import math
>>> zero=0.0
>>> math.atan2(zero,zero)
Traceback (innermost last):
File "<stdin>", line 1, in ?
ValueError: math domain error
>>>
no11[101]nonius% uname -a
IRIX no11 5.3 02091401 IP22 mips
So it is not portable.....
IIRC, on a VAX Using -0.0 would result in an "operand reserved to digital"
fault.
Regards,
--
===== rob at hooft.net http://www.xs4all.nl/~hooft/rob/ =====
===== R&D, Nonius BV, Delft http://www.nonius.nl/ =====
===== PGPid 0xFA19277D ========================== Use Linux! =========
More information about the Python-list
mailing list