Skip to content

Commit 5f48a1b

Browse files
committed
HACK - disable some floor exact tests for PPC
The significand digits for longdouble on PPC (double-double pair) appear to be conservative, so the tests for behavior outside the integer range fail, because we don't know what the integer range is.
1 parent 9e0f052 commit 5f48a1b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nibabel/tests/test_floating.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
""" Test floating point deconstructions and floor methods
22
"""
3+
from platform import processor
4+
35
import numpy as np
46

57
from ..casting import (floor_exact, as_int, FloatingError, int_to_float,
@@ -191,6 +193,10 @@ def test_floor_exact():
191193
assert_equal(int_flex(-iv, t), -iv)
192194
assert_equal(int_flex(iv-1, t), iv-1)
193195
assert_equal(int_flex(-iv+1, t), -iv+1)
196+
# The nmant value for longdouble on PPC appears to be conservative, so
197+
# that the tests for behavior above the nmant range fail
198+
if t is np.longdouble and processor() == 'powerpc':
199+
continue
194200
# 2**(nmant+1) can't be exactly represented
195201
iv = 2**(nmant+1)
196202
assert_equal(int_flex(iv+1, t), iv)

0 commit comments

Comments
 (0)