Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!usenet.ukfsn.org!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: Arithmetic overflow checking Date: Fri, 22 Jul 2011 13:07:45 +0000 (UTC) Organization: UK Free Software Network Lines: 19 Message-ID: References: <015aeb15-57db-48ab-9cd4-77f8448b632f@w24g2000yqw.googlegroups.com> <2rydnez7l-H5BYnTnZ2dnUVZ_vGdnZ2d@earthlink.com> <4e278a67$0$309$14726298@news.sunsite.dk> <1SSVp.69032$_I7.18660@newsfe08.iad> <4e2892f1$0$309$14726298@news.sunsite.dk> NNTP-Posting-Host: 84.45.235.129 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: localhost.localdomain 1311340065 31695 84.45.235.129 (22 Jul 2011 13:07:45 GMT) X-Complaints-To: usenet@localhost.localdomain NNTP-Posting-Date: Fri, 22 Jul 2011 13:07:45 +0000 (UTC) User-Agent: Pan/0.133 (House of Butterflies) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6397 On Thu, 21 Jul 2011 15:58:44 -0700, Patricia Shanahan wrote: > On 7/21/2011 1:58 PM, Arne Vajhøj wrote: >> But I find it hard to believe to be a significant problem in typical >> business apps. > > I agree. After all, it is no worse than "ADD 1 TO AGREECOUNT GIVING > AGREECOUNT.". > But if its critical that a number doesn't overflow, adding an "ON SIZE ERROR" clause to that sentence will catch arithmetic overflow and also check that the result fits in the receiving field while giving the programmer the ability specify the corrective action. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |