# A plea for int overflow checking as the default

**URL:** <https://discourse.julialang.org/t/a-plea-for-int-overflow-checking-as-the-default/3338>\
**Category:** Internals & Design\
**Tags:** question, proposal, integer-overflow\
**Created:** [April 22, 2017, 3:49pm UTC](https://discourse.julialang.org/t/a-plea-for-int-overflow-checking-as-the-default/3338 "2017-04-22T15:49:16Z")\
**Posts on this page:** 1\
**Page:** 5

<div class="post-metadata">

**Author:** ![kollanda](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kollanda/32/31980_2.png) [@kollanda](https://discourse.julialang.org/u/kollanda)\
**Post date:** [December 17, 2021, 2:18am UTC](https://discourse.julialang.org/t/a-plea-for-int-overflow-checking-as-the-default/3338/81 "2021-12-17T02:18:36Z")

</div>

This is very late, but I currently spend some spare time reading about people’s issues with overflow (and behavior of languages).

> from the Python ecosystem (mostly numpy & pandas)

While core Python expands integers to accommodate any integer and will not overflow, numpy’s arithmetic is modular when using integer types, and no error is raised on overflow. Therefore, the behaviour of NumPy and Python integer types differs significantly for integer overflows.

[Pandas](https://github.com/pandas-dev/pandas/issues/15557#issuecomment-283945105) confirms that in general, neither pandas nor numpy check integer operations for overflow.

You can try  
np.sum([2147483647,0], dtype=np.int32)  
np.sum([2147483647,1], dtype=np.int32)

[Previous page](https://discourse.julialang.org/t/a-plea-for-int-overflow-checking-as-the-default/3338.md?page=4)
