Commits

Christian Tismer committed b9e354a Merge

merge

Comments (0)

Files changed (2)

pypy/module/math/test/test_math.py

+from __future__ import with_statement
 import sys
 from pypy.conftest import gettestobjspace
 from pypy.module.math.test import test_direct
             def __trunc__(self):
                 return "truncated"
         assert math.trunc(foo()) == "truncated"
+
+    def test_copysign_nan(self):
+        import math
+        assert math.copysign(1.0, float('-nan')) == -1.0

pypy/objspace/std/strutil.py

         return INFINITY
     elif low == "infinity" or low == "+infinity":
         return INFINITY
-    elif low == "nan" or low == "-nan" or low == "+nan":
+    elif low == "nan" or low == "+nan":
         return NAN
+    elif low == "-nan":
+        return -NAN
 
     try:
         return rstring_to_float(s)