[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: better float2str() C code, anyone?
- From: Doug Currie <e@...>
- Date: Wed, 1 Dec 2004 17:19:11 -0500
>> Users complaint that this is an error in Lua! And it does not help
>> to point them to docs like http://lua-users.org/wiki/FloatingPoint
> Can you imagine a document that it would be helpful to point your users
> at? If you can, then perhaps we can write it.
Papers for the technical user, or anyone who wants to solve this
problem for their platform, should see:
David M. Gay, "Correctly Rounded Binary-Decimal and Decimal-Binary
Conversions", Numerical Analysis Manuscript No. 90-10, Bell Labs,
Murray Hill, 1990;
which also references "How to Print Floating-Point Numbers Accurately"
by Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90] and
William D. Clinger's paper "How to Read Floating Point Numbers
Accurately" [Proc. ACM SIGPLAN '90].
Implementations by Gay are in glibc (I believe) and also available
from the AT&T archives, netlib, in newlib's libm, among other places.
I have used Gay's 1991 implementation in embedded products, via
newlib, and have been quite pleased with the performance and results.