diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2015-05-10 10:47:07 -0400 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-05-10 10:47:07 -0400 |
commit | c65fc9e36b287461040615a452e0268bbca9f3ca (patch) | |
tree | 45e038f121684df8f41797df25fdaca8c415fb63 /numpy/random/tests/test_regression.py | |
parent | 59de9f290b9180e316d319d6b70f65554cd2ef4e (diff) | |
parent | c7f121abb24e19c34246c8ad834dfdd5bd5ce8b2 (diff) | |
download | numpy-c65fc9e36b287461040615a452e0268bbca9f3ca.tar.gz |
Merge pull request #5858 from jaimefrio/random_beta
BUG: random.beta with small parameters
Diffstat (limited to 'numpy/random/tests/test_regression.py')
-rw-r--r-- | numpy/random/tests/test_regression.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/random/tests/test_regression.py b/numpy/random/tests/test_regression.py index 1a5854e82..52be0d4d5 100644 --- a/numpy/random/tests/test_regression.py +++ b/numpy/random/tests/test_regression.py @@ -93,5 +93,13 @@ class TestRegression(TestCase): np.random.multivariate_normal([0], [[0]], size=np.int_(1)) np.random.multivariate_normal([0], [[0]], size=np.int64(1)) + def test_beta_small_parameters(self): + # Test that beta with small a and b parameters does not produce + # NaNs due to roundoff errors causing 0 / 0, gh-5851 + np.random.seed(1234567890) + x = np.random.beta(0.0001, 0.0001, size=100) + assert_(not np.any(np.isnan(x)), 'Nans in np.random.beta') + + if __name__ == "__main__": run_module_suite() |