[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: better float2str() C code, anyone?
- From: Asko Kauppi <asko.kauppi@...>
- Date: Tue, 30 Nov 2004 12:34:16 +0200
All I want to please is the Lua engine itself, really, and for that
this code (bugs aside) seems sufficient. It goes hand-in-hand with the
two places where I suggested using 'number2str()'.
I'd be delighted if my little codie gets into the 'etc/' or something
in future Lua. :)
30.11.2004 kello 12:26, Luiz Henrique de Figueiredo kirjoitti:
As part of my ARM-linux adaptation work (see other msg) I did the
attached 'float2str()' code. It's a quickie, and I'd want to replace
it with (a similar sized) tested & proven Open Source approach. But
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.
Having said that, a simple and small code for floating-point -> text
would be ideal for Lua installations that don't or can't use libc.
Try http://www.netlib.org/fp/ for excellent-quality, but large, code.
(There's even some code by Rob Pike and Ken Thompson.)