GNU bug report logs - #16365
(* 0 +inf.0) rationale is flawed

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guile; Reported by: Zefram <zefram@HIDDEN>; dated Mon, 6 Jan 2014 00:18:01 UTC; Maintainer for guile is bug-guile@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 6 Jan 2014 00:17:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 05 19:17:33 2014
Received: from localhost ([127.0.0.1]:37310 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Vzxsq-00073J-Lm
	for submit <at> debbugs.gnu.org; Sun, 05 Jan 2014 19:17:33 -0500
Received: from eggs.gnu.org ([208.118.235.92]:54758)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <zefram@HIDDEN>) id 1Vzxso-00073B-Gm
 for submit <at> debbugs.gnu.org; Sun, 05 Jan 2014 19:17:31 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <zefram@HIDDEN>) id 1Vzxsn-0001ed-Dh
 for submit <at> debbugs.gnu.org; Sun, 05 Jan 2014 19:17:30 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:41153)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <zefram@HIDDEN>) id 1Vzxsn-0001eZ-9o
 for submit <at> debbugs.gnu.org; Sun, 05 Jan 2014 19:17:29 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:56468)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <zefram@HIDDEN>) id 1Vzxsm-00045I-4J
 for bug-guile@HIDDEN; Sun, 05 Jan 2014 19:17:29 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <zefram@HIDDEN>) id 1Vzxsl-0001dL-CK
 for bug-guile@HIDDEN; Sun, 05 Jan 2014 19:17:28 -0500
Received: from river.fysh.org ([2001:41d0:8:d47f::2]:52604)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <zefram@HIDDEN>) id 1Vzxsl-0001d0-5m
 for bug-guile@HIDDEN; Sun, 05 Jan 2014 19:17:27 -0500
Received: from zefram by river.fysh.org with local (Exim 4.80 #2 (Debian))
 id 1Vzxsd-0002kF-SG; Mon, 06 Jan 2014 00:17:19 +0000
Date: Mon, 6 Jan 2014 00:17:19 +0000
From: Zefram <zefram@HIDDEN>
To: bug-guile@HIDDEN
Subject: (* 0 +inf.0) rationale is flawed
Message-ID: <20140106001719.GI21945@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

Commit 5e7918077a4015768a352ab19e4a8e94531bc8aa says

      A note on the rationale for (* 0 +inf.0) being a NaN and not exact 0:
      The R6RS requires that (/ 0 0.0) return a NaN value, and that (/ 0.0)
      return +inf.0.  We would like (/ x y) to be the same as (* x (/ y)),

This identity doesn't actually hold.  For example, on guile 2.0.9 with
IEEE double flonums:

scheme@(guile-user)> (/ (expt 2.0 -20) (expt 2.0 -1026))
$36 = 6.857655085992111e302
scheme@(guile-user)> (* (expt 2.0 -20) (/ (expt 2.0 -1026)))
$37 = +inf.0

This case arises because the dynamic range of this flonum format is
slightly asymmetric: 2^-1026 is representable, but 2^1026 overflows.

So the rationale for (* 0 +inf.0) yielding +nan.0 is flawed.  As the
supposed invariant and the rationale are not in the actual documentation
(only mentioned in the commit log) this is not necessarily a bug.
But worth thinking again to determine whether the case for adopting
the flonum behaviour here is still stronger than the obvious case for
the exact zero to predominate.  (Mathematically, multiplying zero by an
infinite number does yield zero.  Let alone multiplying it by a merely
large finite number, which is what the flonum indefinite `infinity'
really represents.)

-zefram




Acknowledgement sent to Zefram <zefram@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guile@HIDDEN. Full text available.
Report forwarded to bug-guile@HIDDEN:
bug#16365; Package guile. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.