[pypy-commit] pypy win32-cleanup2: make sure float('nan') does not set the sign bit

mattip noreply at buildbot.pypy.org
Sun Apr 8 14:46:59 CEST 2012


Author: Matti Picus <matti.picus at gmail.com>
Branch: win32-cleanup2
Changeset: r54253:7a8139560192
Date: 2012-04-08 15:42 +0300
http://bitbucket.org/pypy/pypy/changeset/7a8139560192/

Log:	make sure float('nan') does not set the sign bit

diff --git a/pypy/module/rctime/test/test_rctime.py b/pypy/module/rctime/test/test_rctime.py
--- a/pypy/module/rctime/test/test_rctime.py
+++ b/pypy/module/rctime/test/test_rctime.py
@@ -108,7 +108,10 @@
         assert long(rctime.mktime(rctime.gmtime(t))) - rctime.timezone == long(t)
         ltime = rctime.localtime()
         assert rctime.mktime(tuple(ltime)) == rctime.mktime(ltime)
-
+        try:
+            rctime.localtime(-1)
+        except:
+            skip('localtime cannot be negative on this platform')
         assert rctime.mktime(rctime.localtime(-1)) == -1
 
     def test_asctime(self):
diff --git a/pypy/translator/c/src/ll_math.c b/pypy/translator/c/src/ll_math.c
--- a/pypy/translator/c/src/ll_math.c
+++ b/pypy/translator/c/src/ll_math.c
@@ -20,7 +20,7 @@
 #define PyPy_IS_INFINITY(X) ((X) &&                                   \
                              (Py_FORCE_DOUBLE(X)*0.5 == Py_FORCE_DOUBLE(X)))
 #endif
-#define PyPy_NAN (HUGE_VAL * 0.)
+#define PyPy_NAN fabs(HUGE_VAL * 0.)
 
 /* The following copyright notice applies to the original
    implementations of acosh, asinh and atanh. */


More information about the pypy-commit mailing list