PEP 238 (revised)

John W. Baxter jwbaxter at spamcop.com
Fri Jul 27 20:05:26 EDT 2001


In article <mailman.996267654.842.python-list at python.org>, Tim Peters
<tim.one at home.com> wrote:

> Here's one way to tell:
> 
> >>> import math
> >>> math.atan2(x, x)
> -3.1415926535897931
> >>> math.atan2(0, 0)
> 0.0
> >>>
> 
> That is, I really did get minus 0 on Windows!  BTW, that also hints at why
> signed zeroes can be a life-saver when doing complex arithmetic.  However,
> whether atan2() handles signed zeroes correctly also varies across
> platforms.


OK, here is a PowerPC result which suggests--if I'm understanding
you--that
>>> -0.0 
0.0
on PowerPC is a printing issue not a real +0.0 value issue:

>>> math.atan2(-0.0, -0.0)
-3.1415926535897931
>>> math.atan2(0.0, 0.0)
0.0

The Python is:
Python 2.1 (#1, 04/22/01, 11:06:25) 
[GCC Apple DevKit-based CPP 6.0alpha] on darwin1
Type "copyright", "credits" or "license" for more information.

The machine is Dual 533 Mac "G4" running Mac OS X 10.0.4.  Just in case
this all show up in published notes somewhere.

  --John



More information about the Python-list mailing list