diff options
author | Raghuveer Devulapalli <raghuveer.devulapalli@intel.com> | 2020-02-18 20:40:32 -0800 |
---|---|---|
committer | Raghuveer Devulapalli <raghuveer.devulapalli@intel.com> | 2020-02-18 20:40:32 -0800 |
commit | ce86ca5589469f4382f9c66b6464668855984b4c (patch) | |
tree | 6540a463473c43dfbfd35f8b103c2a78493bb2d5 /numpy/core/tests | |
parent | c698bc257ce57cb2f40fbc44c47a6449545194ac (diff) | |
download | numpy-ce86ca5589469f4382f9c66b6464668855984b4c.tar.gz |
TST: Add test to ensure assert_array_max_ulp ignores ULP differences betwen NAN's
Diffstat (limited to 'numpy/core/tests')
-rw-r--r-- | numpy/core/tests/test_umath_accuracy.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/tests/test_umath_accuracy.py b/numpy/core/tests/test_umath_accuracy.py index f3281e418..fd7214396 100644 --- a/numpy/core/tests/test_umath_accuracy.py +++ b/numpy/core/tests/test_umath_accuracy.py @@ -52,3 +52,9 @@ class TestAccuracy: outval = outval[perm] maxulperr = data_subset['ulperr'].max() assert_array_max_ulp(npfunc(inval), outval, maxulperr) + + def test_ignore_nan_ulperror(self): + # Ignore ULP differences between various NAN's + nan1_f32 = np.array(str_to_float('0xffffffff'), dtype=np.float32) + nan2_f32 = np.array(str_to_float('0x7fddbfbf'), dtype=np.float32) + assert_array_max_ulp(nan1_f32, nan2_f32, 0) |