This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients mark.dickinson, skrah
Date 2009-11-09.11:31:36
SpamBayes Score 1.7515971e-08
Marked as misclassified No
Message-id <1257766298.73.0.112313414909.issue7281@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-11-09 11:31:38mark.dickinsonsetrecipients: + mark.dickinson, skrah
2009-11-09 11:31:38mark.dickinsonsetmessageid: <1257766298.73.0.112313414909.issue7281@psf.upfronthosting.co.za>
2009-11-09 11:31:37mark.dickinsonlinkissue7281 messages
2009-11-09 11:31:37mark.dickinsoncreate