From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21672 invoked by alias); 3 Sep 2012 16:32:59 -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: 30654 Received: (qmail 22921 invoked from network); 3 Sep 2012 16:32:51 -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: Mon, 3 Sep 2012 18:26:02 +0200 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: Re: PATCH: prevent SIGFPE on systems where LONG_MIN < -LONG_MAX Message-ID: <20120903162602.GP19561@xvii.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org References: <20120903155732.6e0ed125@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailer-Info: http://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.21-6215-vl-r53514 (2012-07-22) On 2012-09-03 17:08:18 +0200, Jérémie Roquet wrote: > I think we want a warning, as we have for division by zero. I don't think so. The division by zero is mathematically undefined, so that a warning is fine. But a division by -1 could be replaced by a negate operation; then you have the usual modular arithmetic rules. They already occur for $ echo $[ 2**63 ] -9223372036854775808 anyway. > The shell should not crash, neither should it return incorrect > results. Agreed. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)