summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Buitinck <larsmans@gmail.com>2015-01-27 16:31:37 +0100
committerLars Buitinck <larsmans@gmail.com>2015-02-07 13:38:56 +0100
commit24cf7c9671b45e891a6c35b4f576fff3dff5c00e (patch)
tree56532c6ccbf4a32fcf3fbf13293e586ffc9e4157
parent1b21f1f36cad96ee4a3294830742b56e2b830b79 (diff)
downloadcython-24cf7c9671b45e891a6c35b4f576fff3dff5c00e.tar.gz
test: assert that isinf returns -1 for negative infinity
Makes sure (and documents, in a sense) that isinf's declaration as returning a bint preserves its C semantics.
-rw-r--r--tests/run/numpy_math.pyx3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/run/numpy_math.pyx b/tests/run/numpy_math.pyx
index 48fe7cce8..eafd23a81 100644
--- a/tests/run/numpy_math.pyx
+++ b/tests/run/numpy_math.pyx
@@ -37,7 +37,8 @@ def test_fp_classif():
assert not npmath.isnan(d_zero)
assert not npmath.isnan(f_zero)
- assert npmath.isinf(npmath.INFINITY)
+ assert npmath.isinf(npmath.INFINITY) == 1
+ assert npmath.isinf(-npmath.INFINITY) == -1
assert npmath.isnan(npmath.NAN)
assert npmath.signbit(npmath.copysign(1., -1.))