GNU bug report logs - #13757
Problems with Guile's number printer

Previous Next

Package: guile;

Reported by: Andy Wingo <wingo <at> pobox.com>

Date: Tue, 19 Feb 2013 08:20:01 UTC

Severity: normal

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13757 in the body.
You can then email your comments to 13757 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#13757; Package guile. (Tue, 19 Feb 2013 08:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andy Wingo <wingo <at> pobox.com>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Tue, 19 Feb 2013 08:20:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andy Wingo <wingo <at> pobox.com>
To: bug-guile <bug-guile <at> gnu.org>
Cc: , Mark H Weaver <mhw <at> netris.org>,
	Daniel Llorens <daniel.llorens <at> bluewin.ch>
Subject: Problems with Guile's number printer
Date: Tue, 19 Feb 2013 09:18:07 +0100
Hi,

I'm redirecting the number printing conversation to bug-guile, so that
we can track it.  Thanks for the debugging!

On Tue 19 Feb 2013 00:12, Mark H Weaver <mhw <at> netris.org> writes:

> Andy Wingo <wingo <at> pobox.com> writes:
>
>> On Wed 23 Jan 2013 13:20, Daniel Llorens <daniel.llorens <at> bluewin.ch> writes:
>>
>>> scheme@(guile-user)> (f64vector-ref #s64(1 2 3) 0)
>>> $1 = #.#
>>
>> Here you are interpreting an int64 as a double, which should work, but
>> this printed result is really bizarre and looks like a bug in our number
>> printer.  Mark? :)
>
> Yes, our number printer is seriously flawed and needs a rewrite.  It
> prints subnormal[1] floats as "#.#", and even in typical cases often
> fails to print enough digits to get the same number back when you read
> it back in.
>
> Note that this also affects compiled code involving numbers, because the
> compiler serializes numbers using 'number->string'.  For example,
> (* 1e-155 1e-155) returns #f at the REPL, because peval turns this into
> a constant which happens to be a subnormal.  During assembly it serializes
> this to "#.#", and then 'string->number' returns #f.
>
> Also, 3.14159265358979323846264338327950288419716939937510582097494, if
> compiled, fails to produce the float closest to pi.  (acos -1) works
> properly, but only because this expression is not currently folded to a
> constant by the compiler.
>
> I've already started work on this (based on "Printing Floating-Point
> Numbers Quickly and Accurately" by Burger and Dybvig) but got
> distracted.
>
>      Mark
>
> [1] http://en.wikipedia.org/wiki/Subnormal_number

-- 
http://wingolog.org/




Reply sent to Mark H Weaver <mhw <at> netris.org>:
You have taken responsibility. (Mon, 18 Mar 2013 01:32:02 GMT) Full text and rfc822 format available.

Notification sent to Andy Wingo <wingo <at> pobox.com>:
bug acknowledged by developer. (Mon, 18 Mar 2013 01:32:02 GMT) Full text and rfc822 format available.

Message #10 received at 13757-done <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: Andy Wingo <wingo <at> pobox.com>
Cc: 13757-done <at> debbugs.gnu.org, Daniel Llorens <daniel.llorens <at> bluewin.ch>
Subject: Re: Problems with Guile's number printer
Date: Sun, 17 Mar 2013 21:29:39 -0400
I've pushed 1ea37620c2c1794f7685b312d2530676a078ada7 to stable-2.0,
which fixes our number printer.  Closing this bug.

   Thanks,
     Mark





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 15 Apr 2013 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 13 days ago.

Previous Next


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