summaryrefslogtreecommitdiff
path: root/numpy/random/tests/test_random.py
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-17 16:57:47 +0100
commit93c4cd4baf01d405a23116311a8fe548e9893bc7 (patch)
treea46d77a5fd95cc0cb08791b6b49d7a26b5691ef3 /numpy/random/tests/test_random.py
parent305c302e0e5a877f81fcaf9ef00a289528f8466e (diff)
downloadnumpy-93c4cd4baf01d405a23116311a8fe548e9893bc7.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.
Diffstat (limited to 'numpy/random/tests/test_random.py')
-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 3589f4c36..dc7d18933 100644
--- a/numpy/random/tests/test_random.py
+++ b/numpy/random/tests/test_random.py
@@ -819,7 +819,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)