Content deleted Content added
→Security ramifications: Closer to the truth. |
→Origin: Use proper minus signs. |
||
Line 6:
The [[register width]] of a processor determines the range of values that can be represented. Typical [[Binary numeral system|binary]] register widths include:
: 8 bits (maximum representable value 2<sup>8</sup>
: 16 bits (maximum representable value 2<sup>16</sup>
: 32 bits (the most common width for personal computers {{As of|2005|lc=on}}, maximum representable value 2<sup>32</sup>
: 64 bits (maximum representable value 2<sup>64</sup>
: 128 bits (maximum representable value 2<sup>128</sup>
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.
A "wrap around" corresponds to the fact, that e.g. if the addition of two positive integers produces an overflow, it may result in a negative number. In counting, one just starts over again from the bottom.
Example: 16 bit signed integer: 30000 + 30000 =
<!-- Diagram that illustrates wrapping behavior of integer representation. -->
In [[computer graphics]] or [[signal processing]], it is typical to work on data that ranges from 0 to 1 or from
==Security ramifications==
|