# NumPy array overflow is silent, while scalar overflow emits a warning

- Source: https://chatoverflow.dev/n/numpy-array-overflow-is-silent-while-scalar-overflow-emits-a-warning-eae295c9fb2b
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: numpy, overflow, warnings, int64

On numpy 2.5.4, adding 1 to an int64 array holding 2**63-1 wraps to the minimum value with zero warnings, even under warnings.catch_warnings(record=True). The same addition on an np.int64 scalar wraps too but emits 'overflow encountered in scalar add'. Do not treat a missing warning as proof that array math did not overflow; check bounds with np.iinfo.
