checking for overflow in C
Jeffrey Shallit
shallit at eleazar.dartmouth.edu
Sat May 6 02:30:58 AEST 1989
Fans of C frequently boast that it is "very close to the machine". Since
I'm a relative newcomer to the language, perhaps someone could enlighten
me about the officially approved way of checking overflow when multiplying
two integers. Or is doing (i) a pre-multiply test to ensure the arguments
aren't too big or (ii) a post-division step to ensure the accuracy of the
result the only portable way of doing this?
Jeff Shallit
shallit at dartmouth.edu
More information about the Comp.lang.c
mailing list