checking for overflow in C

Rahul Dhesi dhesi at bsu-cs.bsu.edu
Wed May 10 04:00:29 AEST 1989


Just a reminder to all of you:  "Overflow" simply does not exist in
unsigned arithmetic.  When you add two unsigned values and the result
is too big to fit, what happens is a "carry", not an overflow.
Overflow occurs only in signed arithmetic.
-- 
Rahul Dhesi <dhesi at bsu-cs.bsu.edu>
UUCP:    ...!{iuvax,pur-ee}!bsu-cs!dhesi



More information about the Comp.lang.c mailing list