diff options
author | Pauli Virtanen <pav@iki.fi> | 2009-11-13 19:18:10 +0000 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2009-11-13 19:18:10 +0000 |
commit | d6997779c47c3ea56df71cdabfea9f425b2ed3a7 (patch) | |
tree | 5e799a605c501bc537e9f60f16acacc5c3e2cd72 /numpy/testing/utils.py | |
parent | 9d48a39d23b507e18ca8fa7c5786b5eaea926d0e (diff) | |
download | numpy-d6997779c47c3ea56df71cdabfea9f425b2ed3a7.tar.gz |
BUG: use %g format in assert_array_*_nulp (fix #1297, thanks to Neil Muller)
Diffstat (limited to 'numpy/testing/utils.py')
-rw-r--r-- | numpy/testing/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index 7009d532c..708293a35 100644 --- a/numpy/testing/utils.py +++ b/numpy/testing/utils.py @@ -1109,7 +1109,7 @@ def assert_array_almost_equal_nulp(x, y, nulp=1): if not np.all(np.abs(x-y) <= ref): max_nulp = np.max(nulp_diff(x, y)) raise AssertionError("X and Y are not equal to %d ULP "\ - "(max is %d)" % (nulp, max_nulp)) + "(max is %g)" % (nulp, max_nulp)) def assert_array_max_ulp(a, b, maxulp=1, dtype=None): """Given two arrays a and b, check that every item differs in at most N @@ -1117,7 +1117,7 @@ def assert_array_max_ulp(a, b, maxulp=1, dtype=None): import numpy as np ret = nulp_diff(a, b, dtype) if not np.all(ret <= maxulp): - raise AssertionError("Arrays are not almost equal up to %d ULP" % \ + raise AssertionError("Arrays are not almost equal up to %g ULP" % \ maxulp) return ret |