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: Sun, 06 Feb 2011 14:15:42 +0000 Message-ID: <87d3n5mb2g.fsf@ossau.uklinux.net> References: <87ipx4vtvg.fsf@yeeloong.netris.org> <87mxmf1gi3.fsf@ossau.uklinux.net> <87k4hjuu82.fsf@yeeloong.netris.org> <87bp2vtduh.fsf@ossau.uklinux.net> <87ei7runpa.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 1297007101 22593 80.91.229.12 (6 Feb 2011 15:45:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 6 Feb 2011 15:45:01 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Feb 06 16:44:56 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 1Pm6nI-0002wU-0G for guile-devel@m.gmane.org; Sun, 06 Feb 2011 16:44:56 +0100 Original-Received: from localhost ([127.0.0.1]:45021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pm6e6-0005la-1v for guile-devel@m.gmane.org; Sun, 06 Feb 2011 10:35:26 -0500 Original-Received: from [140.186.70.92] (port=46320 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pm6df-0005VR-Ck for guile-devel@gnu.org; Sun, 06 Feb 2011 10:35:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pm6da-0003KK-Kc for guile-devel@gnu.org; Sun, 06 Feb 2011 10:34:56 -0500 Original-Received: from mail3.uklinux.net ([80.84.72.33]:55867) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pm6da-0003GQ-CR for guile-devel@gnu.org; Sun, 06 Feb 2011 10:34:54 -0500 Original-Received: from arudy (unknown [78.145.29.123]) by mail3.uklinux.net (Postfix) with ESMTP id 0B8EB1F6639; Sun, 6 Feb 2011 15:34:23 +0000 (GMT) Original-Received: from neil-laptop (unknown [192.168.11.4]) by arudy (Postfix) with ESMTP id 4341438013; Sun, 6 Feb 2011 15:34:16 +0000 (GMT) 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:11536 Archived-At: Mark H Weaver writes: > Neil Jerram writes: >> >> In other words, the argument is that any inexact number might actually >> be infinite. (Right?) > > Yes. > >> 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)). > > There are some cases where it can be proven, but anytime you divide by > an inexact number (or apply any other function with singularities), you > must assume that the finiteness of the result is unknown. Again, that seems impractical to me. Just as many inexact number calculations are provably finite, there are many inexact number calculations that are provably non-zero. This approach seems like letting the tail wag the dog. However, as you've indicated by your question below, what matters for our purposes is whether it makes a difference to programming. So I'll put my intuition aside and focus on that. >> 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. > > Can you give a practical example where it is important for (* 0 X) for > inexact X to produce an exact 0? If I understood why this was important > (besides the aesthetics of an exact result), I might be more motivated > to try to produce an exact 0 when possible. No, I can't. If a program knew for sure that a multiplication included an exact 0, and that the other arguments were all finite, there would be no point having the multiplication there. In other cases, if a program needed to rely on the result of a multiplication being exact, it would either have to know that all the arguments were exact, or use inexact->exact. I think that leaves no cases where it makes a practical difference whether (* 0 X) is exact or inexact. So on that basis I'm happy to concede this point. Many thanks for your patient explanations, and for all your work on these numeric patches. Regards, Neil