diff options
author | Nathaniel J. Smith <njs@pobox.com> | 2015-11-18 08:29:28 +0000 |
---|---|---|
committer | Nathaniel J. Smith <njs@pobox.com> | 2015-11-18 08:29:28 +0000 |
commit | d05d26a5b3fb9b1add1b9a13836d3c8a20ca1d9d (patch) | |
tree | e0b266be60e878adcee4261bcf392d23027d06fd | |
parent | 60d1bc626b73c45735f23bf7dd37539fa67d4ddd (diff) | |
parent | 8d00317744444ed5b5fc4c454c9c0040c8999f1d (diff) | |
download | numpy-d05d26a5b3fb9b1add1b9a13836d3c8a20ca1d9d.tar.gz |
Merge pull request #6698 from matthew-brett/test-rint-bug
TST: test np.rint bug for large integers
-rw-r--r-- | numpy/core/tests/test_umath.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py index 541ad974b..2ba988b87 100644 --- a/numpy/core/tests/test_umath.py +++ b/numpy/core/tests/test_umath.py @@ -1926,5 +1926,15 @@ def test_complex_nan_comparisons(): assert_equal(x == y, False, err_msg="%r == %r" % (x, y)) +def test_rint_big_int(): + # np.rint bug for large integer values on Windows 32-bit and MKL + # https://github.com/numpy/numpy/issues/6685 + val = 4607998452777363968 + # This is exactly representable in floating point + assert_equal(val, int(float(val))) + # Rint should not change the value + assert_equal(val, np.rint(val)) + + if __name__ == "__main__": run_module_suite() |