summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2017-01-17 16:42:34 +0100
committerJulian Taylor <jtaylor.debian@googlemail.com>2017-01-19 13:11:18 +0100
commiteec6a5752596b32cba121931f7b8c278a5d90a7d (patch)
tree7a0189c3abda49373c5e8e39a0e4ff4436ca06e1
parent66a93e4ec698dc230d5415b314e61a7dd573e043 (diff)
downloadnumpy-eec6a5752596b32cba121931f7b8c278a5d90a7d.tar.gz
TST: work around isfinite inconsistency on i386
inlined isfinite on i386 does not work for DBL_MAX / 1e17 + DBL_MAX as with extended precision this is not smaller equal than DBL_MAX.
-rw-r--r--numpy/random/tests/test_random.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py
index 47301a770..517cf4d93 100644
--- a/numpy/random/tests/test_random.py
+++ b/numpy/random/tests/test_random.py
@@ -813,7 +813,9 @@ class TestRandomDist(TestCase):
assert_raises(OverflowError, func, [0], [np.inf])
# (fmax / 1e17) - fmin is within range, so this should not throw
- np.random.uniform(low=fmin, high=fmax / 1e17)
+ # account for i386 extended precision DBL_MAX / 1e17 + DBL_MAX >
+ # DBL_MAX by increasing fmin a bit
+ np.random.uniform(low=np.nextafter(fmin, 1), high=fmax / 1e17)
def test_vonmises(self):
np.random.seed(self.seed)