Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.16.MISMATCH!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!p29g2000pre.googlegroups.com!not-for-mail From: lewbloch Newsgroups: comp.lang.java.programmer Subject: Re: Arithmetic overflow checking Date: Thu, 21 Jul 2011 09:03:36 -0700 (PDT) Organization: http://groups.google.com Lines: 33 Message-ID: <7a23c9d2-508f-4dbd-af91-8cdf2a9764e1@p29g2000pre.googlegroups.com> References: <015aeb15-57db-48ab-9cd4-77f8448b632f@w24g2000yqw.googlegroups.com> <1f9c17dltrhlmhifuigoa914477r4rg1e1@4ax.com> <09fe171s46ilvq9qmn254dctunm6noh0ps@4ax.com> <4e262731$0$314$14726298@news.sunsite.dk> <4e26300b$0$309$14726298@news.sunsite.dk> <4e26b4ed$0$2501$db0fefd9@news.zen.co.uk> <4e28097f$0$2533$da0feed9@news.zen.co.uk> NNTP-Posting-Host: 127.6.6.6 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1311267971 30997 127.0.0.1 (21 Jul 2011 17:06:11 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 21 Jul 2011 17:06:11 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p29g2000pre.googlegroups.com; posting-host=127.6.6.6; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: ASELCHRU X-HTTP-UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.56 Safari/535.1,gzip(gfe) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6345 On Jul 21, 8:38=A0am, Andreas Leitgeb wrote: > lewbloch wrote: > > And what about the suggestion to write a CheckedInteger type that does > > what you need? > > That has been answered already, but you may have missed it, or maybe > blocked the one who answered this seriously and (imho) agreeably. > > Due to Java's lack of operator overloading, doing Math with > non-primitive types is just painful. > I saw that suggestion, but painful !=3D impossible. And how freaking "painful" is it to read method calls anyway? "Painful" is digging ditches, tarring roofs, smelting steel, even working the floor at your neighborhood mall anchor store. All a programmer has to do is read method calls and do some typing. People need to get over themselves. So for those who "can't" do range checking because "method calls are too 'painful'" - Shut The Front Door, whiner! Jesus H. Tap-dancing Christ! Or get out of programming and get a real job. Do keep agitating for a better way. Just don't cavil that there's no way to do it now, because there is. Amazing. Yeesh. -- Lew