Mark Dickinson <dicki...@gmail.com> added the comment:

Just to confirm the above:

In 2.6, PyFloat_FromString in Objects/floatobject.c ends up using the
system strtod to parse "nan" and "-nan" (except that if the system
strtod fails to recognise "nan" for some reason then it returns the
result of 0.0 * Infinity instead, and in that case disregards the sign).
 In 2.7 and 3.x, it ends up calling _Py_parse_inf_or_nan in
Python/pystrtod.c, and this returns 0.0 * Infinity for "nan" and -(0.0 *
Infinity) for "-nan".  And depending on compiler flags, 0.0 * Infinity
ends up being either +nan (this usually seems to happen when
optimization is on, so that the compiler itself evaluates 0.0 *
Infinity), or -nan (which happens when there's no optimization and the
FPU ends up doing the 0.0 * Infinity multiplication at runtime.) This
should explain the results you're seeing.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7281>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to