From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.devel Subject: Project: a good floating point printer/reader. Date: 09 May 2002 22:17:13 +0200 Sender: guile-devel-admin@gnu.org Message-ID: <87vg9xjcty.fsf@zagadka.ping.de> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1020975541 21145 127.0.0.1 (9 May 2002 20:19:01 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 9 May 2002 20:19:01 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 175uNQ-0005Uw-00 for ; Thu, 09 May 2002 22:19:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 175uNA-0003fj-00; Thu, 09 May 2002 16:18:44 -0400 Original-Received: from dialin.speedway42.dip10.dokom.de ([195.138.42.10] helo=zagadka.ping.de) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 175uLj-0003a8-00 for ; Thu, 09 May 2002 16:17:15 -0400 Original-Received: (qmail 5496 invoked by uid 1000); 9 May 2002 20:17:13 -0000 Original-To: guile-devel@gnu.org, guile-user@gnu.org Original-Lines: 44 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:595 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:595 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