diff options
| author | Anirudh Subramanian <anirudh2290@ufl.edu> | 2020-05-18 21:00:12 +0000 |
|---|---|---|
| committer | Anirudh Subramanian <anirudh2290@ufl.edu> | 2020-06-05 18:37:11 +0000 |
| commit | d08bdbabc19116afecc773bdbe590ba93471f2fc (patch) | |
| tree | 738419a82f265849c93e733521a61a29c83c205d /numpy | |
| parent | 64e525d4333e5cac8d04debfe205cb779f0e4d68 (diff) | |
| download | numpy-d08bdbabc19116afecc773bdbe590ba93471f2fc.tar.gz | |
ENH: divmod(inf, inf) should raise invalid error on all platforms
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/core/src/npymath/npy_math_internal.h.src | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/core/src/npymath/npy_math_internal.h.src b/numpy/core/src/npymath/npy_math_internal.h.src index dfebc197a..1637d438b 100644 --- a/numpy/core/src/npymath/npy_math_internal.h.src +++ b/numpy/core/src/npymath/npy_math_internal.h.src @@ -669,7 +669,9 @@ npy_divmod@c@(@type@ a, @type@ b, @type@ *modulus) mod = npy_fmod@c@(a, b); - if (!b) { + if (npy_isinf(b) && npy_isinf(a)) { + npy_set_floatstatus_invalid(); + } else if (!b) { div = a / b; npy_set_floatstatus_invalid(); if (a) { |
