From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16362 invoked by alias); 4 Sep 2012 23:50:42 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30657 Received: (qmail 9275 invoked from network); 4 Sep 2012 23:50:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at vinc17.net does not designate permitted sender hosts) Date: Wed, 5 Sep 2012 01:50:34 +0200 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: Re: PATCH: prevent SIGFPE on systems where LONG_MIN < -LONG_MAX Message-ID: <20120904235034.GQ19561@xvii.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org References: <20120903155732.6e0ed125@pwslap01u.europe.root.pri> <20120903162602.GP19561@xvii.vinc17.org> <20120904192644.661329c3@pws-pc.ntlworld.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20120904192644.661329c3@pws-pc.ntlworld.com> X-Mailer-Info: http://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.21-6215-vl-r53514 (2012-07-22) On 2012-09-04 19:26:44 +0100, Peter Stephenson wrote: > > > The shell should not crash, neither should it return incorrect > > > results. > > > > Agreed. > > Well, that depends what you mean by an incorrect result. Mathematically > incorrect results are inevitable if you don't account of the precision, > but we don't warn for any other rounding error so I agree there's no > reason to here. Here these are integer operations, and it seems that zsh chose modular arithmetic, so that a "correct" representable result is always possible under these conditions ("correct" but not necessarily meaningful, but no-one can prevent the user from writing meaningless expressions). -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)