diff options
author | Julian Taylor <jtaylor.debian@googlemail.com> | 2016-01-11 20:55:46 +0100 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2016-01-11 22:55:14 +0100 |
commit | dde1112f4476862e1e028d048bde23027ec5441c (patch) | |
tree | 5aefbdcf75580b1ebe3a5c6ea31523f762a3334e | |
parent | 3a9c90cbfd6057e9f124f3d31b82f8c0ad22cd20 (diff) | |
download | numpy-dde1112f4476862e1e028d048bde23027ec5441c.tar.gz |
BUG: make result of isfinite/isinf/signbit a boolean
may return something else than one or zero and npy_bool is
unfortunately an int8 not a c99 bool
-rw-r--r-- | numpy/core/src/umath/simd.inc.src | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/core/src/umath/simd.inc.src b/numpy/core/src/umath/simd.inc.src index 21ff97784..5da87ef60 100644 --- a/numpy/core/src/umath/simd.inc.src +++ b/numpy/core/src/umath/simd.inc.src @@ -559,7 +559,7 @@ static void sse2_signbit_@TYPE@(npy_bool * op, @type@ * ip1, npy_intp n) { LOOP_BLOCK_ALIGN_VAR(ip1, @type@, 16) { - op[i] = npy_signbit(ip1[i]); + op[i] = npy_signbit(ip1[i]) != 0; } LOOP_BLOCKED(@type@, 16) { @vtype@ a = @vpre@_load_@vsuf@(&ip1[i]); @@ -576,7 +576,7 @@ sse2_signbit_@TYPE@(npy_bool * op, @type@ * ip1, npy_intp n) } } LOOP_BLOCKED_END { - op[i] = npy_signbit(ip1[i]); + op[i] = npy_signbit(ip1[i]) != 0; } } @@ -600,7 +600,7 @@ sse2_@kind@_@TYPE@(npy_bool * op, @type@ * ip1, npy_intp n) #endif #endif LOOP_BLOCK_ALIGN_VAR(ip1, @type@, 16) { - op[i] = npy_@kind@(ip1[i]); + op[i] = npy_@kind@(ip1[i]) != 0; } LOOP_BLOCKED(@type@, 64) { @vtype@ a = @vpre@_load_@vsuf@(&ip1[i + 0 * 16 / sizeof(@type@)]); @@ -641,7 +641,7 @@ sse2_@kind@_@TYPE@(npy_bool * op, @type@ * ip1, npy_intp n) sse2_compress4_to_byte_@TYPE@(r1, r2, r3, &r4, &op[i]); } LOOP_BLOCKED_END { - op[i] = npy_@kind@(ip1[i]); + op[i] = npy_@kind@(ip1[i]) != 0; } /* silence exceptions from comparisons */ npy_clear_floatstatus(); |