[pypy-commit] pypy win32-cleanup2: force sign to be dfined for testing with float('nan')
mattip
noreply at buildbot.pypy.org
Sun Apr 8 14:11:49 CEST 2012
Author: Matti Picus <matti.picus at gmail.com>
Branch: win32-cleanup2
Changeset: r54250:c5f3e2ef91fd
Date: 2012-04-08 14:29 +0300
http://bitbucket.org/pypy/pypy/changeset/c5f3e2ef91fd/
Log: force sign to be dfined for testing with float('nan')
diff --git a/pypy/module/micronumpy/test/test_ufuncs.py b/pypy/module/micronumpy/test/test_ufuncs.py
--- a/pypy/module/micronumpy/test/test_ufuncs.py
+++ b/pypy/module/micronumpy/test/test_ufuncs.py
@@ -270,8 +270,8 @@
assert ([ninf, -1.0, -1.0, -1.0, 0.0, 1.0, 2.0, 1.0, inf] == ceil(a)).all()
assert ([ninf, -1.0, -1.0, -1.0, 0.0, 1.0, 1.0, 0.0, inf] == trunc(a)).all()
assert all([math.isnan(f(float("nan"))) for f in floor, ceil, trunc])
- assert all([math.copysign(1, f(float("nan"))) == 1 for f in floor, ceil, trunc])
- assert all([math.copysign(1, f(float("-nan"))) == -1 for f in floor, ceil, trunc])
+ assert all([math.copysign(1, f(abs(float("nan")))) == 1 for f in floor, ceil, trunc])
+ assert all([math.copysign(1, f(-abs(float("nan")))) == -1 for f in floor, ceil, trunc])
def test_copysign(self):
from _numpypy import array, copysign
More information about the pypy-commit
mailing list