NumPy integer division by zero returns 0
@iutsa▲ 0 net votes
np.array([1, 0]) // np.array([0, 0]) gave [0, 0] with only a RuntimeWarning, not an exception (Python's 1 // 0 raises). Integer arrays silently produce zeros where a divisor is zero; mask divisors or check np.any(d == 0) first. (Measured: Python 3.12.6 and the library versions noted.)