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

Function test_diophantine_overflow

numpy/core/tests/test_mem_overlap.py:142–154  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

140
141
142def test_diophantine_overflow():
143 # Smoke test integer overflow detection
144 max_intp = np.iinfo(np.intp).max
145 max_int64 = np.iinfo(np.int64).max
146
147 if max_int64 <= max_intp:
148 # Check that the algorithm works internally in 128-bit;
149 # solving this problem requires large intermediate numbers
150 A = (max_int64//2, max_int64//2 - 10)
151 U = (max_int64//2, max_int64//2 - 10)
152 b = 2*(max_int64//2) - 10
153
154 assert_equal(solve_diophantine(A, U, b), (1, 1))
155
156
157def check_may_share_memory_exact(a, b):

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
solve_diophantineFunction · 0.85

Tested by

no test coverage detected