8000 Merge pull request #6698 from matthew-brett/test-rint-bug · numpy/numpy@d05d26a · GitHub
[go: up one dir, main page]

Skip to content

Commit d05d26a

Browse files
committed
Merge pull request #6698 from matthew-brett/test-rint-bug
TST: test np.rint bug for large integers
2 parents 60d1bc6 + 8d00317 commit d05d26a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

numpy/core/tests/test_umath.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,5 +1926,15 @@ def test_complex_nan_comparisons():
19261926
assert_equal(x == y, False, err_msg="%r == %r" % (x, y))
19271927

19281928

1929+
def test_rint_big_int():
1930+
# np.rint bug for large integer values on Windows 32-bit and MKL
1931+
# https://github.com/numpy/numpy/issues/6685
1932+
val = 4607998452777363968
1933+
# This is exactly representable in floating point
1934+
assert_equal(val, int(float(val)))
1935+
# Rint should not change the value
1936+
assert_equal(val, np.rint(val))
1937+
1938+
19291939
if __name__ == "__main__":
19301940
run_module_suite()

0 commit comments

Comments
 (0)
0