lua-users home
lua-l archive

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

* Mike Pall:

> The problem is deep inside libc in strtod() and sprintf(). These
> can neither be easily replaced, nor easily convinced to ignore the
> locale.

Most languages ship something like gdtoa because the C implementations
are not useful.  Google Go has a MIT-licensed implementation, too.  In
both cases, there are functions for the opposite conversion which are
not lossy and produce the shortest possible representation (i.e.,
"0.2" instead of "0.20000000000000001").  This would address the
surprising property that tostring of a number is lossy.