diff options
author | Chris Sidebottom <chris.sidebottom@arm.com> | 2023-05-02 15:44:51 +0100 |
---|---|---|
committer | Chris Sidebottom <chris.sidebottom@arm.com> | 2023-05-02 15:48:30 +0100 |
commit | 9bbd76af79d1c3657d24fce1eba6086e5038e4df (patch) | |
tree | a3d4b378ae6a91d80a8c4b8915195c0455319f70 /numpy/core | |
parent | c43ae85bdd44174c0f2867adc85fe94cbc626873 (diff) | |
download | numpy-9bbd76af79d1c3657d24fce1eba6086e5038e4df.tar.gz |
Add test case for underflow exception
Co-authored-by: Pierre Blanchard <Pierre.Blanchard@arm.com>
Diffstat (limited to 'numpy/core')
-rw-r--r-- | numpy/core/tests/test_umath.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py index 438b5600a..0fc5d93f9 100644 --- a/numpy/core/tests/test_umath.py +++ b/numpy/core/tests/test_umath.py @@ -1437,6 +1437,16 @@ class TestSpecialFloats: assert_equal(np.cos(yf), xf) @pytest.mark.skipif(IS_WASM, reason="fp errors don't work in wasm") + def test_sincos_underflow(self): + with np.errstate(under='raise'): + underflow_trigger = np.array( + float.fromhex("0x1.f37f47a03f82ap-511"), + dtype=np.float64 + ) + np.sin(underflow_trigger) + np.cos(underflow_trigger) + + @pytest.mark.skipif(IS_WASM, reason="fp errors don't work in wasm") @pytest.mark.parametrize('callable', [np.sin, np.cos]) @pytest.mark.parametrize('dtype', ['e', 'f', 'd']) @pytest.mark.parametrize('value', [np.inf, -np.inf]) |