Author: mattip <[email protected]>
Branch: numpy-fixes
Changeset: r76948:15dee07ee651
Date: 2015-04-28 00:18 +0300
http://bitbucket.org/pypy/pypy/changeset/15dee07ee651/

Log:    special case sign(nan)

diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py
--- a/pypy/module/micronumpy/types.py
+++ b/pypy/module/micronumpy/types.py
@@ -722,6 +722,8 @@
     def sign(self, v):
         if v == 0.0:
             return 0.0
+        if rfloat.isnan(v):
+            return rfloat.NAN
         return rfloat.copysign(1.0, v)
 
     @raw_unary_op
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to