lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


on 20/6/02 2:18 PM, Luiz Henrique de Figueiredo at lhf@tecgraf.puc-rio.br
wrote:


> (If someone knows a fast, small, portable function that converts
> floating-point
> numbers to strings such that converting the string back to a number gives the
> *same* number, please let me know. I know about the ones by David Gay in
> netlib,
> but they're too complicated.)
> --lhf

I guess it depends on why you want to turn the number in to a string. If all
you want to achieve is reversible serialisation, converting the FP number's
binary representation in to a hex string is pretty damn quick (and simple),
and reversible, I'd hope :)

Cheers,
    Benjohn