Content deleted Content added
Line 30:
Most computers have two dedicated processor flags to check for overflow conditions.
The [[carry flag]] is set when the result of an addition or subtraction, considering the operands and result as unsigned numbers, does not fit in the given number of bits. This indicates an overflow with a [[carry (arithmetic)|''carry''
The [[overflow flag]] is set when the result of an operation on signed numbers does not have the sign that one would predict from the signs of the operands, e.g. a negative result when adding two positive numbers. This indicates that an overflow has occurred and the signed result represented in [[two's complement]] form would not fit in the given number of bits.
|