Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2e12ac9

Browse files
committed
Merge pull request #7167 from anntzer/fix-normalize-test-on-quadruple-precision
TST: Less stringent normalization test for float128.
1 parent cf8e669 commit 2e12ac9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/matplotlib/tests/test_colors.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ def test_Normalize():
207207
# and for scalar ones.
208208
eps = np.finfo(np.longdouble).resolution
209209
norm = plt.Normalize(1, 1 + 100 * eps)
210-
assert_equal(norm(1 + 50 * eps), .5)
210+
# This returns exactly 0.5 when longdouble is extended precision (80-bit),
211+
# but only a value close to it when it is quadruple precision (128-bit).
212+
assert 0 < norm(1 + 50 * eps) < 1
211213

212214

213215
def test_SymLogNorm():

0 commit comments

Comments
 (0)