From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: Strange division using mixed integers and floats Date: Wed, 28 Apr 2004 16:02:50 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1083164676 7165 80.91.224.253 (28 Apr 2004 15:04:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 28 Apr 2004 15:04:36 +0000 (UTC) Cc: rms@gnu.org, =?iso-8859-1?q?Johan_Bockg=E5rd?= , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Apr 28 17:04:22 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 1BIqbm-0007q2-00 for ; Wed, 28 Apr 2004 17:04:22 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BIqbl-0006mP-00 for ; Wed, 28 Apr 2004 17:04:21 +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 1BIqas-0003pC-0T for emacs-devel@quimby.gnus.org; Wed, 28 Apr 2004 11:03:26 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BIq4A-0004mH-96 for emacs-devel@gnu.org; Wed, 28 Apr 2004 10:29:38 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BIq1Z-0003mA-B8 for emacs-devel@gnu.org; Wed, 28 Apr 2004 10:27:28 -0400 Original-Received: from [195.135.220.2] (helo=Cantor.suse.de) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.30) id 1BIpex-0006Ao-0W; Wed, 28 Apr 2004 10:03:35 -0400 Original-Received: from hermes.suse.de (Hermes.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 8E89B4FB020; Wed, 28 Apr 2004 16:03:28 +0200 (CEST) Original-To: David Kastrup X-Yow: I'm in direct contact with many advanced fun CONCEPTS. In-Reply-To: (David Kastrup's message of "28 Apr 2004 13:05:31 +0200") User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) 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:22302 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:22302 David Kastrup writes: > Efficiency? Lisp is not a statically typed language. We don't know > the type of the arguments until after they have been evaluated. > > We would have to store all intermediate results away before being > allowed to do the first operation. Which we do anyway, since / is not a special form. Arguments of normal functions are always evaluated before being applied. > Also (/ 5 4 2.3) would no longer be equivalent to (/ (/ 5 4) 2.3). I don't think it was ever documented as such. The Emacs Lisp manual only covers the case of all arguments being integers, but does not specificall= y say anything about mixed mode arguments, except that a floating point value is returned if any argument is floating. So always using floating point arithmetics in this case would fit the principle of least surprise. Andreas. --=20 Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstra=DFe 5, 90409 N=FCrnberg, Germany Key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."