checking for overflow in C

Doug Gwyn gwyn at smoke.BRL.MIL
Mon May 8 07:09:28 AEST 1989


In article <13367 at dartvax.Dartmouth.EDU> shallit at eleazar.dartmouth.edu (Jeffrey Shallit) writes:
>... enlighten me about the officially approved way of checking overflow when
>multiplying two integers.

Patient:  Doctor, it hurts when I do this.
Doctor:  Don't do that!

You're looking for tactics when what is needed is better strategy.
How did you get your algorithm into the state where an overflow is
even possible?  Sounds to me like the algorithm needs to be better
engineered.



More information about the Comp.lang.c mailing list