<P> 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 . </P> <P> For an unsigned type, when the ideal result of an operation is outside the types representable range and the returned result is obtained by wrapping, then this event is commonly defined as an overflow . In contrast, the C11 standard defines that this event is not an overflow and states "a computation involving unsigned operands can never overflow ." </P> <P> When the ideal result of an integer operation is outside the types representable range and the returned result is obtained by clamping, then this event is commonly defined as a saturation . Usage varies as to whether a saturation is or is not an overflow . To eliminate ambiguity, the terms wrapping overflow and saturating overflow can be used . </P> <P> The term underflow is most commonly used for floating - point math and not for integer math . But, many references can be found to integer underflow . When the term integer underflow is used, it means the ideal result was closer to minus infinity than the output type's representable value closest to minus infinity . When the term integer underflow is used, the definition of overflow may include all types of overflows or it may only include cases where the ideal result was closer to positive infinity than the output type's representable value closest to positive infinity . </P>

What happens when the result of a calculation exceeds the capacity of data type