Skip to content

Commit

Permalink
TST: Update exp test to check for spurious over and underflow flag
Browse files Browse the repository at this point in the history
  • Loading branch information
r-devulap committed Feb 3, 2022
1 parent 0d1d76e commit e3cb0a7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions numpy/core/tests/test_umath.py
Original file line number Diff line number Diff line change
Expand Up @@ -995,12 +995,13 @@ def test_exp_strides(self):

class TestSpecialFloats:
def test_exp_values(self):
x = [np.nan, np.nan, np.inf, 0.]
y = [np.nan, -np.nan, np.inf, -np.inf]
for dt in ['f', 'd', 'g']:
xf = np.array(x, dtype=dt)
yf = np.array(y, dtype=dt)
assert_equal(np.exp(yf), xf)
with np.errstate(under='raise', over='raise'):
x = [np.nan, np.nan, np.inf, 0.]
y = [np.nan, -np.nan, np.inf, -np.inf]
for dt in ['f', 'd', 'g']:
xf = np.array(x, dtype=dt)
yf = np.array(y, dtype=dt)
assert_equal(np.exp(yf), xf)

# See: https://github.com/numpy/numpy/issues/19192
@pytest.mark.xfail(
Expand Down

0 comments on commit e3cb0a7

Please sign in to comment.