Skip to content

Commit ce86ca5

Browse files
committed
TST: Add test to ensure assert_array_max_ulp ignores ULP differences betwen NAN's
1 parent c698bc2 commit ce86ca5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

numpy/core/tests/test_umath_accuracy.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,9 @@ def test_validate_transcendentals(self):
5252
outval = outval[perm]
5353
maxulperr = data_subset['ulperr'].max()
5454
assert_array_max_ulp(npfunc(inval), outval, maxulperr)
55+
56+
def test_ignore_nan_ulperror(self):
57+
# Ignore ULP differences between various NAN's
58+
nan1_f32 = np.array(str_to_float('0xffffffff'), dtype=np.float32)
59+
nan2_f32 = np.array(str_to_float('0x7fddbfbf'), dtype=np.float32)
60+
assert_array_max_ulp(nan1_f32, nan2_f32, 0)

0 commit comments

Comments
 (0)