Skip to content

Commit 6b9955c

Browse files
committed
BF: use smaller float type for rounding error test
ulp rounding error coming back as biggest float type. This can give very slightly different answers from error predicted from tested float type. Convert to tested float type for test.
1 parent a852b77 commit 6b9955c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nibabel/tests/test_round_trip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def test_big_bad_ulp():
8484
in_arr = np.array([0, 0, 1, 2, 4, 5, -5, -np.inf, np.inf], dtype=ftype)
8585
out_arr = [min_ulp, min_ulp, fi.eps, fi.eps * 2, fi.eps * 4,
8686
fi.eps * 4, fi.eps * 4, np.inf, np.inf]
87-
assert_array_equal(big_bad_ulp(in_arr), out_arr)
87+
assert_array_equal(big_bad_ulp(in_arr).astype(ftype), out_arr)
8888

8989

9090
BIG_FLOAT = np.float64

0 commit comments

Comments
 (0)