Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Daniele Futtorovic Newsgroups: comp.lang.java.programmer Subject: Re: Arithmetic overflow checking Date: Sun, 17 Jul 2011 17:14:38 +0200 Organization: A noiseless patient Spider Lines: 17 Message-ID: References: <015aeb15-57db-48ab-9cd4-77f8448b632f@w24g2000yqw.googlegroups.com> <1f9c17dltrhlmhifuigoa914477r4rg1e1@4ax.com> <658108b9-3fa9-41dd-8701-9f342633864c@x12g2000yql.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Injection-Date: Sun, 17 Jul 2011 15:14:54 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="wPi9lIeh+Zbf1c90w8aX3g"; logging-data="17307"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/a9XTd2B/6fQ47nXgtvo5M" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 In-Reply-To: Cancel-Lock: sha1:jg3EfdStNA/51u2FspQs7FnvnFI= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6244 On 11/07/2011 23:49, Joshua Cranmer allegedly wrote: > On 7/11/2011 2:43 PM, Gene Wirchenko wrote: >> On Mon, 11 Jul 2011 10:30:26 -0700, Joshua Cranmer >> wrote: >> Averaging a set of numbers with a sum too big would be caught by >> overflow checking and not bounds checking. > > What I advocated would basically be a "checked integer": every operation > is guaranteed to have a result between [min, max]; if not, it throws an > exception. Sounds cool. Any chance we might see it in teh Jav one day? And is there actually hardware support for it? -- DF. Determinism trumps correctness.