From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Strange division using mixed integers and floats Date: 28 Apr 2004 13:05:31 +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=us-ascii X-Trace: sea.gmane.org 1083156296 15926 80.91.224.253 (28 Apr 2004 12:44:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 28 Apr 2004 12:44:56 +0000 (UTC) Cc: =?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 14:44:46 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 1BIoQg-0004tj-00 for ; Wed, 28 Apr 2004 14:44:46 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BIoQf-0004Hr-00 for ; Wed, 28 Apr 2004 14:44:46 +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 1BIoMK-0007tf-4Z for emacs-devel@quimby.gnus.org; Wed, 28 Apr 2004 08:40:16 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BInI8-0008Jo-Em for emacs-devel@gnu.org; Wed, 28 Apr 2004 07:31:52 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BInDI-0007on-8G for emacs-devel@gnu.org; Wed, 28 Apr 2004 07:27:23 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BImst-0004wV-AR for emacs-devel@gnu.org; Wed, 28 Apr 2004 07:05:47 -0400 Original-Received: from fencepost.gnu.org ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.24) id 1BImqX-0004Db-91; Wed, 28 Apr 2004 07:03:21 -0400 Original-To: rms@gnu.org In-Reply-To: Original-Lines: 23 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 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:22297 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:22297 Richard Stallman writes: > But this behaviour is *highly* confusing: > > (/ 5 4 2.3) => 0.4347826086956522 > > Cf. (/ 5 4.0 2.3) => 0.5434782608695653 > > We could change the functions to convert the arguments to > floating point at the start if any is floating point. > > Is there any reason not to do that? 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. Also (/ 5 4 2.3) would no longer be equivalent to (/ (/ 5 4) 2.3). -- David Kastrup, Kriemhildstr. 15, 44793 Bochum