From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: Fix for inconsistent (/ DIVIDEND DIVISOR &rest DIVISORS) Date: Tue, 4 May 2004 18:51:31 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20040504225131.GA16973@fencepost> References: <200405042227.i44MRBME009469@brains.moreideas.ca> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1083711707 22568 80.91.224.253 (4 May 2004 23:01:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 4 May 2004 23:01:47 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed May 05 01:01:40 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BL8uy-00076u-00 for ; Wed, 05 May 2004 01:01:40 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BL8ux-0003yX-00 for ; Wed, 05 May 2004 01:01:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BL8s6-0002Ez-5p for emacs-devel@quimby.gnus.org; Tue, 04 May 2004 18:58:42 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BL8ln-0000iO-9J for emacs-devel@gnu.org; Tue, 04 May 2004 18:52:11 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BL8lA-0000W0-QK for emacs-devel@gnu.org; Tue, 04 May 2004 18:52:05 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BL8l9-0000VS-S7 for emacs-devel@gnu.org; Tue, 04 May 2004 18:51:31 -0400 Original-Received: from miles by fencepost.gnu.org with local (Exim 4.24) id 1BL8l9-0004cj-C5; Tue, 04 May 2004 18:51:31 -0400 Original-To: Peter Whaite Content-Disposition: inline In-Reply-To: <200405042227.i44MRBME009469@brains.moreideas.ca> User-Agent: Mutt/1.3.28i Blat: Foop X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:22768 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:22768 On Tue, May 04, 2004 at 06:27:11PM -0400, Peter Whaite wrote: > Some time ago there was a thread on division being inconsistent when > floats were involved. I dont know what the outcome of that discussion > was, but it did occur to me that the simplest fix would be to multiply > the divisors before doing the division. That might result in overflow where there wasn't any before, especially when all the args are fixnums. E.g., currently: (/ 200000000 100000000 4) => 0 But your change would seem to make it equivalent to: (/ 200000000 (* 100000000 4)) => -1 Given that emacs already has a very restricted integer range, this is an area where we should be very careful. -Miles -- 97% of everything is grunge