Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: supercalifragilisticexpialadiamaticonormalizeringelimatisticantations Newsgroups: comp.lang.java.programmer Subject: Re: Arithmetic overflow checking Date: Sat, 23 Jul 2011 12:04:30 -0400 Organization: supercalifragilisticexpialadiamaticonormalizeringelimatisticantations Lines: 18 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> NNTP-Posting-Host: Zhu192ZE8q2eriSarUeB8w.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: WinVN 0.99.12z (x86 32bit) X-Notice: Filtered by postfilter v. 0.8.2 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6459 On 23/07/2011 11:23 AM, David Lamb wrote: > On 21/07/2011 8:32 AM, Andreas Leitgeb wrote: >> agreeCount = agreeCount.plus(AgreeCount.ONE) >> on painfulness of non-primitive math. > > or if you think ++ is common enough: > agreeCount.increment(); > and generally > agreeCount.add(someOtherAgreeCount) > and if you decide to have your operators return "this" > ac0.mul(ac1).plus(ac2)) // ac0 = ac0*ac1+ac2 > or > ac = (new AgreeCount(ac0)).mul(ac1).plus(ac2) // ac = ac0*ac1+ac2 Eww. Mutable number classes. I think I'm going to throw up.