[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: better float2str() C code, anyone?
- From: Rici Lake <lua@...>
- Date: Wed, 1 Dec 2004 09:26:49 -0500
On 30-Nov-04, at 5:26 AM, Luiz Henrique de Figueiredo wrote:
Floating-point -> text conversion is not a light job. Of course, in
application, you may be able to get away with simple code, but in
if you want to have reversible conversions, then there's a lot to do.
That is true. 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 believe
you need %.19g for the conversion to be reversible.