# integer arithmetic overflow

**URL:** <https://forums.developer.nvidia.com/t/integer-arithmetic-overflow/364>\
**Category:** CUDA Programming and Performance\
**Created:** [March 8, 2007, 8:25pm UTC](https://forums.developer.nvidia.com/t/integer-arithmetic-overflow/364 "2007-03-08T20:25:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhanweck](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jhanweck](https://forums.developer.nvidia.com/u/jhanweck)\
**Post date:** [March 8, 2007, 8:25pm UTC](https://forums.developer.nvidia.com/t/integer-arithmetic-overflow/364/1 "2007-03-08T20:25:20Z")

</div>

Is it defined how integer arithmetic overflows?

For instance, is it guaranteed that adding or multiplying two large unsigned ints will “gracefully” overflow like modulus 2^32?

I imagine this is somewhat hardware specific, so I’ll take GeForce 8800 as the example platform.

---

<div class="post-metadata">

**Author:** ![jhanweck](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jhanweck](https://forums.developer.nvidia.com/u/jhanweck)\
**Post date:** [March 9, 2007, 6:00pm UTC](https://forums.developer.nvidia.com/t/integer-arithmetic-overflow/364/2 "2007-03-09T18:00:14Z")

</div>

p.s. integer math appears to overflow “gracefully” on GeForce 8800 GTS. That is, the low 32 bits are correct.
