From: Marius Vollmer <mvo@zagadka.ping.de>
Subject: Project: a good floating point printer/reader.
Date: 09 May 2002 22:17:13 +0200 [thread overview]
Message-ID: <87vg9xjcty.fsf@zagadka.ping.de> (raw)
Hi,
I think we need a better floating point printer and or reader. The
current ones can not print denormal numbers, and the string printed
will not always read back as the exact same number (as required by
R5RS).
guile> (define (t x) (= x (string->number (number->string x))))
guile> (t 0.1432987654987436)
#f
guile> (t 0.1432987654987430)
#t
(That is no special number. I just tried a couple until t returned #f.)
guile> (/ 1e-308 2)
#.#
Also, Guile should be able to read denormal number:
guile> 1e-309
ERROR: In procedure string->number:
ERROR: Argument out of range: -309
ABORT: (out-of-range)
Good algorithms might be the ones describes in these two papers:
Printing Floating Point Numbers Quickly and Accurately. Robert
G. Burger and R. Kent Dybvig. ACM SIGPLAN 1996 Conference on
Programming Language Design and Implementation, June
1996.
http://www.cs.indiana.edu/~dyb/FP-Printing-PLDI96.ps.gz
William D Clinger. How to Read Floating Point Numbers Accurately. In
Proceedings of the 1990 ACM Conference on Programming Language
Design and Implementation, pages 92-101.
ftp://ftp.ccs.neu.edu/pub/people/will/howtoread.ps
If anyone wants to work on this, that would be great.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next reply other threads:[~2002-05-09 20:17 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-09 20:17 Marius Vollmer [this message]
2002-05-13 21:01 ` Project: a good floating point printer/reader Rob Browning
2002-05-15 18:30 ` Marius Vollmer
2002-05-16 15:35 ` The Guile license and the use of LGPL libs (like GMP) Rob Browning
2002-05-16 16:44 ` Greg Troxel
2002-05-16 17:01 ` Bruce Korb
2002-05-16 17:12 ` Rob Browning
2002-05-21 19:55 ` Carl R. Witty
2002-05-21 23:44 ` Rob Browning
2002-05-16 17:21 ` Jeff Read
2002-05-16 17:22 ` Rob Browning
2002-05-16 20:40 ` Jeff Read
2002-05-16 23:17 ` Rob Browning
2002-05-16 23:35 ` Jeff Read
2002-05-17 0:02 ` Rob Browning
2002-05-28 18:56 ` Marius Vollmer
2002-05-28 18:28 ` Marius Vollmer
2002-05-28 18:54 ` Bruce Korb
2002-05-28 19:23 ` Marius Vollmer
2002-05-28 19:39 ` Bruce Korb
2002-05-28 19:54 ` Marius Vollmer
2002-05-28 20:16 ` Bruce Korb
2002-06-01 16:01 ` Marius Vollmer
2002-05-28 19:02 ` Rob Browning
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87vg9xjcty.fsf@zagadka.ping.de \
--to=mvo@zagadka.ping.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).