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

Method test_minimum_signed_integers

numpy/core/tests/test_multiarray.py:4903–4923  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4901 assert_equal(rarr[np.argmin(rarr)], min_val, err_msg="%r" % rarr)
4902
4903 def test_minimum_signed_integers(self):
4904
4905 a = np.array([1, -2**7, -2**7 + 1, 2**7 - 1], dtype=np.int8)
4906 assert_equal(np.argmin(a), 1)
4907 a = a.repeat(129)
4908 assert_equal(np.argmin(a), 129)
4909
4910 a = np.array([1, -2**15, -2**15 + 1, 2**15 - 1], dtype=np.int16)
4911 assert_equal(np.argmin(a), 1)
4912 a = a.repeat(129)
4913 assert_equal(np.argmin(a), 129)
4914
4915 a = np.array([1, -2**31, -2**31 + 1, 2**31 - 1], dtype=np.int32)
4916 assert_equal(np.argmin(a), 1)
4917 a = a.repeat(129)
4918 assert_equal(np.argmin(a), 129)
4919
4920 a = np.array([1, -2**63, -2**63 + 1, 2**63 - 1], dtype=np.int64)
4921 assert_equal(np.argmin(a), 1)
4922 a = a.repeat(129)
4923 assert_equal(np.argmin(a), 129)
4924
4925class TestMinMax:
4926

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
argminMethod · 0.45

Tested by

no test coverage detected