[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: better float2str() C code, anyone?
- From: David Jones <drj@...>
- Date: Thu, 2 Dec 2004 10:45:23 +0000
On Dec 01, 2004, at 21:37, Asko Kauppi wrote:
Hmm.. could the behaviour be checked at runtime, and altered?
Not easily no.
Though one could check a few commonly bad cases. I see an opportunity
for the autoconf crowd.
1.12.2004 kello 23:25, David Jones kirjoitti:
On Dec 01, 2004, at 14:54, Luiz Henrique de Figueiredo wrote:
One issue I've had from time to time is that the default
#define LUA_NUMBER_FMT "%.14g"
is not long enough to do reversible conversions on doubles. I
you need %.19g for the conversion to be reversible.
I think it's %.17g for IEEE doubles. (Despite what DBL_DIG says!)
Lua was like that once, but then you get ugly things like this:
Users complaint that this is an error in Lua! And it does not help
them to docs like http://lua-users.org/wiki/FloatingPoint ...