lua-users home
lua-l archive

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


On Sun, Mar 25, 2012 at 11:10 AM, Cosmin Apreutesei
<cosmin.apreutesei@gmail.com> wrote:
>> If you are using double-precision Lua numbers (the default), print them
>> with %0.17g. This allows you to read them back without loss.
>
> Thanks, that helped. Could you explain why %0.17g is a losless conversion?

Short version: 17 decimal digits is enough to express 52 binary bits.
(It's actually a bit more than 52 bits.)

/s/ Adam