diff options
author | Matthew Brett <matthew.brett@gmail.com> | 2015-11-17 18:05:45 -0800 |
---|---|---|
committer | Matthew Brett <matthew.brett@gmail.com> | 2015-11-17 18:05:45 -0800 |
commit | 8d00317744444ed5b5fc4c454c9c0040c8999f1d (patch) | |
tree | 600f301bc69dc23cf5cb1030c33681a5b61081cc | |
parent | cbc14f0dcd1896b43630c75a62ccf0ac8847a3c0 (diff) | |
download | numpy-8d00317744444ed5b5fc4c454c9c0040c8999f1d.tar.gz |
TST: test np.rint bug for large integers
Test for https://github.com/numpy/numpy/issues/6685
Add test to remind packagers that they may need to fix or workaround
this bug on some systems.
-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() |