For the exact difference, the representability condition becomesWithin the same operand square , the closed diagonal band between and is representable. Above the upper line, gives negative overflow; below the lower line, gives positive overflow. The right-hand panel of the figure shows these regions, including their representable boundary points.
Positive overflow can occur only when and ; negative overflow can occur only when and . The corresponding exact inequalities are still required: operands with different signs do not always overflow. Same-sign subtraction is always representable. In sign-bit terms, subtraction overflows exactly when the operands have different signs and the wrapped result's sign differs from that of .
One must test subtraction directly or use its correct overflow rule: forming
-y in the same bits fails at , even though some differences with that operand are representable. For example is valid. Articles by others on the same topic
There are currently no matching articles.