Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: checking for overflow in C Message-ID: <10218@smoke.BRL.MIL> Date: 7 May 89 21:09:28 GMT References: <13367@dartvax.Dartmouth.EDU> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 11 In article <13367@dartvax.Dartmouth.EDU> shallit@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.