diff options
| author | rubiales <arubiales11@gmail.com> | 2021-06-22 19:51:59 +0200 |
|---|---|---|
| committer | Sebastian Berg <sebastian@sipsolutions.net> | 2021-07-12 15:32:19 -0500 |
| commit | 1823b55e389fd991fee0d1661d68404defa18ab8 (patch) | |
| tree | 5f67796e4803965ebf216059c7ce3fc16264259c /numpy | |
| parent | b47c3c1c70644c84dac18de878cd53d1b103595a (diff) | |
| download | numpy-1823b55e389fd991fee0d1661d68404defa18ab8.tar.gz | |
solve the problems of mod operator except for infinite values #18170
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/core/src/npymath/npy_math_internal.h.src | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/numpy/core/src/npymath/npy_math_internal.h.src b/numpy/core/src/npymath/npy_math_internal.h.src index ff4663dc3..ee22d72ea 100644 --- a/numpy/core/src/npymath/npy_math_internal.h.src +++ b/numpy/core/src/npymath/npy_math_internal.h.src @@ -423,16 +423,6 @@ NPY_INPLACE @type@ npy_@kind@@c@(@type@ x, @type@ y) NPY_INPLACE @type@ npy_@kind@@c@(@type@ x, @type@ y) { - int are_inputs_inf = (npy_isinf(x) && npy_isinf(y)); - /* force set invalid flag, doesnt raise by default on gcc < 8 */ - if (npy_isnan(x) || npy_isnan(y)) { - npy_set_floatstatus_invalid(); - } - if (are_inputs_inf || !y) { - if (!npy_isnan(x)) { - npy_set_floatstatus_invalid(); - } - } return (@type@) npy_@kind@((double)x, (double) y); } #endif @@ -518,16 +508,7 @@ NPY_INPLACE @type@ npy_@kind@@c@(@type@ x, @type@ y) NPY_INPLACE @type@ npy_@kind@@c@(@type@ x, @type@ y) { - int are_inputs_inf = (npy_isinf(x) && npy_isinf(y)); - /* force set invalid flag, doesnt raise by default on gcc < 8 */ - if (npy_isnan(x) || npy_isnan(y)) { - npy_set_floatstatus_invalid(); - } - if (are_inputs_inf || !y) { - if (!npy_isnan(x)) { - npy_set_floatstatus_invalid(); - } - } + return @kind@@c@(x, y); } #endif @@ -716,9 +697,6 @@ npy_divmod@c@(@type@ a, @type@ b, @type@ *modulus) @type@ div, mod, floordiv; /* force set invalid flag, doesnt raise by default on gcc < 8 */ - if (npy_isnan(a) || npy_isnan(b)) { - npy_set_floatstatus_invalid(); - } mod = npy_fmod@c@(a, b); if (NPY_UNLIKELY(!b)) { div = a / b; |
