diff options
author | Gengxin Xie <gengxin.xie@intel.com> | 2020-04-07 15:11:37 +0800 |
---|---|---|
committer | Gengxin Xie <gengxin.xie@intel.com> | 2020-04-07 15:11:37 +0800 |
commit | d3f5fc5daa1f9db8d8364e28b7c2688ce91f17b4 (patch) | |
tree | 907a226c728c88f7923e078c7ecab9f55521cf96 | |
parent | 39d8c1858217ba761dd9f4ab5fba41eee544e60f (diff) | |
download | numpy-d3f5fc5daa1f9db8d8364e28b7c2688ce91f17b4.tar.gz |
MAINT: Add test cases about +/- INF +/- NAN and overflow
-rw-r--r-- | numpy/core/tests/data/umath-validation-set-exp | 5 | ||||
-rw-r--r-- | numpy/core/tests/test_umath.py | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/numpy/core/tests/data/umath-validation-set-exp b/numpy/core/tests/data/umath-validation-set-exp index 0465bc04f..7c5ef3b33 100644 --- a/numpy/core/tests/data/umath-validation-set-exp +++ b/numpy/core/tests/data/umath-validation-set-exp @@ -172,6 +172,11 @@ np.float64,0xc7efffffe0000000,0x0000000000000000,1 ## overflow ## np.float64,0x40862e52fefa39ef,0x7ff0000000000000,1 np.float64,0x40872e42fefa39ef,0x7ff0000000000000,1 +## +/- INF, +/- NAN ## +np.float64,0x7ff0000000000000,0x7ff0000000000000,1 +np.float64,0xfff0000000000000,0x0000000000000000,1 +np.float64,0x7ff8000000000000,0x7ff8000000000000,1 +np.float64,0xfff8000000000000,0xfff8000000000000,1 ## output denormal ## np.float64,0xc087438520000000,0x0000000000000001,1 np.float64,0xc08743853f2f4461,0x0000000000000001,1 diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py index 233a0b1d6..f8a57d2c2 100644 --- a/numpy/core/tests/test_umath.py +++ b/numpy/core/tests/test_umath.py @@ -652,6 +652,8 @@ class TestSpecialFloats: with np.errstate(over='raise'): assert_raises(FloatingPointError, np.exp, np.float32(100.)) assert_raises(FloatingPointError, np.exp, np.float32(1E19)) + assert_raises(FloatingPointError, np.exp, np.float64(800.)) + assert_raises(FloatingPointError, np.exp, np.float64(1E19)) def test_log_values(self): with np.errstate(all='ignore'): |