Integer overflow: Difference between revisions

Content deleted Content added
See also: link to stack buffer overflow article
Origin: actual max representable value for 128 bit
Line 8:
: 32 bits (the most common width for personal computers [[as of 2005]], maximum representable value 4,294,967,295),
: 64 bits (maximum representable value 18,446,744,073,709,551,615),
: 128 bits (maximum representable value approx. 10<sup>38</sup> — actually, 2<sup>128</sup> - 1)
 
Since an arithmetic operation may produce a result larger than the maximum representable value, a potential error condition may result. In the [[C (programming language)|C programming language]], signed integer overflow causes [[undefined behavior]], while unsigned integer overflow causes the number to be reduced [[modular arithmetic|modulo a power of two]], meaning that unsigned integers "wrap around" on overflow.