[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LuaJIT support "1.0" number format in German (and other) locales
- From: Florian Weimer <fw@...>
- Date: Wed, 09 Mar 2011 20:34:57 +0100
* 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.