MCPcopy Create free account
hub / github.com/numpy/numpy / do_signed_overflow_bounds

Method do_signed_overflow_bounds

numpy/lib/tests/test_histograms.py:326–331  ·  view source on GitHub ↗
(self, dtype)

Source from the content-addressed store, hash-verified

324 assert_equal(t_edge.dtype, td)
325
326 def do_signed_overflow_bounds(self, dtype):
327 exponent = 8 * np.dtype(dtype).itemsize - 1
328 arr = np.array([-2**exponent + 4, 2**exponent - 4], dtype=dtype)
329 hist, e = histogram(arr, bins=2)
330 assert_equal(e, [-2**exponent + 4, 0, 2**exponent - 4])
331 assert_equal(hist, [1, 1])
332
333 def test_signed_overflow_bounds(self):
334 self.do_signed_overflow_bounds(np.byte)

Callers 1

Calls 3

histogramFunction · 0.90
assert_equalFunction · 0.90
dtypeMethod · 0.45

Tested by

no test coverage detected