summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2018-04-30 23:31:21 -0700
committerEric Wieser <wieser.eric@gmail.com>2018-04-30 23:31:21 -0700
commit8ed017a30c8ec60f17538c585f87415a1ca989fc (patch)
treee2c6c40ce082101eb1423a3a0b0d0aa355cc7a58 /numpy/lib/tests
parent4a5d02fe2879846404a2a3a5f347c4c4509ee6d9 (diff)
downloadnumpy-8ed017a30c8ec60f17538c585f87415a1ca989fc.tar.gz
BUG: histogramdd fails on large integers
This is due to gh-11022.
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_histograms.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_histograms.py b/numpy/lib/tests/test_histograms.py
index 8c420bd77..8583efab8 100644
--- a/numpy/lib/tests/test_histograms.py
+++ b/numpy/lib/tests/test_histograms.py
@@ -683,3 +683,15 @@ class TestHistogramdd(object):
assert_equal(edges[0].dtype, x_edges.dtype)
assert_equal(edges[1].dtype, y_edges.dtype)
+
+ def test_large_integers(self):
+ big = 2**60 # Too large to represent with a full precision float
+
+ x = np.array([0], np.int64)
+ x_edges = np.array([-1, +1], np.int64)
+ y = big + x
+ y_edges = big + x_edges
+
+ hist, edges = histogramdd((x, y), bins=(x_edges, y_edges))
+
+ assert_equal(hist[0, 0], 1)