Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.glorb.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Date: Thu, 21 Jul 2011 16:43:46 -0400 From: =?ISO-8859-1?Q?Arne_Vajh=F8j?= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Arithmetic overflow checking References: <015aeb15-57db-48ab-9cd4-77f8448b632f@w24g2000yqw.googlegroups.com> <2rydnez7l-H5BYnTnZ2dnUVZ_vGdnZ2d@earthlink.com> <9LWdnZH2hdfmyYvTnZ2dnUVZ_vidnZ2d@posted.palinacquisition> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Lines: 31 Message-ID: <4e288f85$0$316$14726298@news.sunsite.dk> Organization: SunSITE.dk - Supporting Open source NNTP-Posting-Host: 72.192.23.157 X-Trace: news.sunsite.dk DXC=jI1`o;MfEVT8AmV=S2QQ[\YSB=nbEKnk[XjhVkob8B`VJPe3\kP5EUQKBm9cfh9BSTM2;kT<[:>[Q\``R3S_F;3W`ThcG On Thu, 07 Jul 2011 17:51:06 -0700, Peter Duniho > wrote: >> I would not worry about the "simple" or "efficient" criteria. IMHO, if >> one is deciding to apply overflow checking to every computation, one has >> already abandoned the hope of efficiency. > > Not necessarily. If a rocket ends up being destroyed as a > result, having the computing go a bit slower to save having to build > another rocket would have been more efficient. I am pretty sure that Peter was talking about the efficiency of the computer program. > Unfortunately, this is > not a made-up example. See: > http://en.wikipedia.org/wiki/Ariane_5_Flight_501 > In the subsequent investigation, the cause of the problem was > recreated. It was an integer overflow. But the real problem was a bad software process. If there had not been an integer overflow there could have been many other types of problems. > Turn on those run-time checks unless speed *REALLY* is of > paramount importance. It usually is not. I would agree with that. Arne