Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Henderson Newsgroups: comp.lang.java.programmer Subject: Re: Arithmetic overflow checking Date: Tue, 26 Jul 2011 04:53:15 -0400 Organization: e1 Lines: 17 Message-ID: References: <015aeb15-57db-48ab-9cd4-77f8448b632f@w24g2000yqw.googlegroups.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> <7a23c9d2-508f-4dbd-af91-8cdf2a9764e1@p29g2000pre.googlegroups.com> NNTP-Posting-Host: JGlhbe57/m0Yel4Bc874gw.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:6569 On 26/07/2011 3:28 AM, Joshua Cranmer wrote: > On 7/25/2011 11:12 AM, Henderson wrote: >> Until some enterprising mathematician thinks up something that can be >> added and multiplied, but has no sensible correspondence to any subset >> of any kind of vectors of real numbers ... [delete bestiary] Yeesh. Anyone adding operator overloading to Java in a sane way has his work cut out for him, it seems. > What do you mean by "truncate" in modular arithmetic? Mod 10, 1 and 11 > are the same thing (the set of numbers {..., -9, 1, 11, ... }). As in, if you have a mod10 type, and you assign 36 to it, do you just silently accept that and store it internally as 6, or do you throw an exception if the input isn't in the range 0 to 9?