Content deleted Content added
m In FAA example, showed whole number of days in parenthetical remark relating 2^31 centiseconds to days. Previously showed 11 decimal places, which is not useful. Applied ceiling rather than round operator so that future edits do not inadvertently give too small a number. |
m add specifity to paragraph on wrap-around |
||
Line 24:
* 128 bits: maximum representable value 2<sup>128</sup> − 1 = 340,282,366,920,938,463,463,374,607,431,768,211,455
When an unsigned arithmetic operation produces a result larger than the maximum above for an N-bit integer, an overflow reduces the result to [[modulo operation|modulo]] N-th power of 2, retaining only the least significant bits of the result and effectively causing a ''wrap around''.
In particular, multiplying or adding two integers may result in a value that is unexpectedly small, and subtracting from a small integer may cause a wrap to a large positive value (for example, 8-bit integer addition 255 + 2 results in 1, which is {{math|257 mod 2<sup>8</sup>}}, and similarly subtraction 0 − 1 results in 255, a [[two's complement]] representation of −1).
|