diff options
author | Raghuveer Devulapalli <raghuveer.devulapalli@intel.com> | 2021-05-05 14:51:54 -0700 |
---|---|---|
committer | Raghuveer Devulapalli <raghuveer.devulapalli@intel.com> | 2021-05-05 14:51:54 -0700 |
commit | bf531216d3b70f28c462e457dcda1795a3c28476 (patch) | |
tree | 619e85251256eecc20f9a30449a6134fa27fb1cd /numpy | |
parent | 7ae04a19216c352ee53188fed0b39cd63468caf3 (diff) | |
download | numpy-bf531216d3b70f28c462e457dcda1795a3c28476.tar.gz |
TST: Add test to verify underflow flag is raised for np.exp
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/tests/test_umath.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py index 75e1c99d3..572e736a0 100644 --- a/numpy/core/tests/test_umath.py +++ b/numpy/core/tests/test_umath.py @@ -919,6 +919,12 @@ class TestSpecialFloats: assert_raises(FloatingPointError, np.exp, np.float64(800.)) assert_raises(FloatingPointError, np.exp, np.float64(1E19)) + with np.errstate(under='raise'): + assert_raises(FloatingPointError, np.exp, np.float32(-1000.)) + assert_raises(FloatingPointError, np.exp, np.float32(-1E19)) + assert_raises(FloatingPointError, np.exp, np.float64(-1000.)) + assert_raises(FloatingPointError, np.exp, np.float64(-1E19)) + def test_log_values(self): with np.errstate(all='ignore'): x = [np.nan, np.nan, np.inf, np.nan, -np.inf, np.nan] |