From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Handle products with exact 0 differently, etc Date: Wed, 02 Feb 2011 01:38:46 +0000 Message-ID: <87bp2vtduh.fsf@ossau.uklinux.net> References: <87ipx4vtvg.fsf@yeeloong.netris.org> <87mxmf1gi3.fsf@ossau.uklinux.net> <87k4hjuu82.fsf@yeeloong.netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1296610748 19011 80.91.229.12 (2 Feb 2011 01:39:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 2 Feb 2011 01:39:08 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Feb 02 02:39:01 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PkRgT-0001Ij-Dw for guile-devel@m.gmane.org; Wed, 02 Feb 2011 02:39:01 +0100 Original-Received: from localhost ([127.0.0.1]:40494 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkRgS-00066t-7N for guile-devel@m.gmane.org; Tue, 01 Feb 2011 20:39:00 -0500 Original-Received: from [140.186.70.92] (port=49246 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkRgK-00063j-K7 for guile-devel@gnu.org; Tue, 01 Feb 2011 20:38:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PkRgJ-0001X7-2y for guile-devel@gnu.org; Tue, 01 Feb 2011 20:38:52 -0500 Original-Received: from mail3.uklinux.net ([80.84.72.33]:34912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PkRgI-0001Wz-Uo for guile-devel@gnu.org; Tue, 01 Feb 2011 20:38:51 -0500 Original-Received: from arudy (unknown [78.145.23.182]) by mail3.uklinux.net (Postfix) with ESMTP id 15BC21F6630; Wed, 2 Feb 2011 01:38:49 +0000 (GMT) Original-Received: from neil-laptop (unknown [192.168.11.4]) by arudy (Postfix) with ESMTP id 07DFE3801E; Wed, 2 Feb 2011 01:38:46 +0000 (GMT) In-Reply-To: <87k4hjuu82.fsf@yeeloong.netris.org> (Mark H. Weaver's message of "Tue, 01 Feb 2011 19:59:41 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 80.84.72.33 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11500 Archived-At: Mark H Weaver writes: > The point of the exact/inexact distinction is to ensure that if you see > an exact number, you can trust that it is provably the correct answer, > and that no inaccuracies associated with inexact arithmetic along the > way could possibly have corrupted that answer. Yes, I think I understand that. > In this case, the inaccuracies associated with inexact arithmetic could > result in an infinity being misrepresented as a finite number, or vice > versa. For example, if X is inexact, then we cannot claim that the > result of (* 0 (/ X)) is an exact 0, because a small change in X could > affect the final answer. In other words, the argument is that any inexact number might actually be infinite. (Right?) That strikes me as stretching the idea of inexactness too far; and also as not useful, because I'm sure there are many practical ways of producing inexact numbers that are provably finite (e.g. sqrt(5)). My guess is that for the majority of programming situations where I have an inexact number X, that number is provably finite, and so I'd want (* 0 X) to be an exact 0. But I'm not an expert, and I'm not actually writing those programs now... Are you following specific references here? FWIW, for cases like this, the last para of R6RS 11.7.1 allows "either 0 (exact) or 0.0 (inexact)". Neil