GNU bug report logs - #7436
[PATCH] ftoastr: new module, for lossless conversion of floats to short strings

Previous Next

Package: coreutils;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Thu, 18 Nov 2010 17:31:02 UTC

Severity: normal

Tags: patch

Done: Jim Meyering <jim <at> meyering.net>

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 7436 in the body.
You can then email your comments to 7436 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 owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#7436; Package coreutils. (Thu, 18 Nov 2010 17:31:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Eggert <eggert <at> cs.ucla.edu>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Thu, 18 Nov 2010 17:31:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Jim Meyering <jim <at> meyering.net>
Cc: Bug-coreutils <bug-coreutils <at> gnu.org>, Bug-gnulib <bug-gnulib <at> gnu.org>
Subject: Re: [PATCH] ftoastr: new module, for lossless conversion of floats
	to short strings
Date: Thu, 18 Nov 2010 09:35:20 -0800
On 11/18/10 08:36, Jim Meyering wrote:
> Before I'd looked through the code I started thinking this might
> be useful in avoiding snprintf's unhealthy need to malloc.
> Then I saw that it uses snprintf.  Oh well ;-)

There's a comment on how to fix that, for the common cases of
double on float on hosts with IEEE floating point and 64-bit ints.
It's a paper published earlier this year by Florian Loitsch
<http://dx.doi.org/10.1145/1809028.1806623>.  Not only would
this fix the malloc problem, it would run rings around sprintf,
performance-wise, on all libc implementations that I know of
that print floating-point numbers accurately.

The idea behind the latest checkin has been in Emacs for years, but the
immediate prompt for it was a bug that I found in coreutils
od, when I attempted to use it to generate floating point
numbers at random (by reading /dev/urandom).  The generated numbers
turned out to be non-random, and I tracked it down to a bug
in od.  I'll check in a fix to coreutils shortly.




bug closed, send any further explanations to 7436 <at> debbugs.gnu.org and Paul Eggert <eggert <at> cs.ucla.edu> Request was from Jim Meyering <jim <at> meyering.net> to control <at> debbugs.gnu.org. (Tue, 19 Apr 2011 07:13:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 17 May 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 93 days ago.

Previous Next


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