Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!s2g2000vbw.googlegroups.com!not-for-mail From: Malcolm McLean Newsgroups: comp.lang.java.programmer,comp.lang.c Subject: Re: Arithmetic overflow checking Date: Sun, 10 Jul 2011 06:52:03 -0700 (PDT) Organization: http://groups.google.com Lines: 12 Message-ID: References: <015aeb15-57db-48ab-9cd4-77f8448b632f@w24g2000yqw.googlegroups.com> <2rydnez7l-H5BYnTnZ2dnUVZ_vGdnZ2d@earthlink.com> <9LWdnZH2hdfmyYvTnZ2dnUVZ_vidnZ2d@posted.palinacquisition> <3797038f-22d1-40b2-8c12-60db5a0976b8@t5g2000yqj.googlegroups.com> NNTP-Posting-Host: 132.77.4.43 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1310305923 17813 127.0.0.1 (10 Jul 2011 13:52:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 10 Jul 2011 13:52:03 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s2g2000vbw.googlegroups.com; posting-host=132.77.4.43; posting-account=Dz2zqgkAAADlK5MFu78bw3ab-BRFV4Qn User-Agent: G2/1.0 X-HTTP-Via: 1.1 wisweb (NetCache NetApp/6.0.6) X-Google-Web-Client: true X-Google-Header-Order: HCUALESRFV X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0,gzip(gfe) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6045 comp.lang.c:8070 On Jul 10, 4:28=A0pm, Eric Sosman wrote: > > =A0 =A0 =A0This is true only for `unsigned' integer arithmetic. =A0Signed > integer arithmetic is in fact vulnerable to overflow. > All arithmetic is vulnerable to overflow. The question is whether the system reports and error or gives wrong results. Sometimes wrong results are better than errors, for instance in video games, but only rarely. -- Learn all about MPI Tutorial on my website: http://www.malcolmmclean.site11.com/www