Signed zeros: is this a bug?

Mark Dickinson dickinsm at gmail.com
Sun Mar 11 13:33:29 EDT 2007


On Mar 11, 1:21 pm, Duncan Booth <duncan.bo... at invalid.invalid> wrote:
> Tim Peters wrote inhttp://blog.gmane.org/gmane.comp.python.devel/day=20050409:
>
> > All Python behavior in the presence of a NaN, infinity, or signed zero
> > is a platform-dependent accident.  This is because C89 has no such
> > concepts, and Python is written to the C89 standard.  It's not easy to
> > fix across all platforms (because there is no portable way to do so in
> > standard C), although it may be reasonably easy to fix if all anyone
> > cares about is gcc and MSVC (every platform C compiler has its own set
> > of gimmicks for "dealing with" these things).

Understood. Platform dependent is fine.  But does this really excuse
results
like the following?

>>> from math import atan2
>>> x = -0.; print atan2(0., -1.)
-3.14159265359
>>> print atan2(0., -1.)
3.14159265359

Mark




More information about the Python-list mailing list