[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: serialization of lua numbers
- From: Coda Highland <chighland@...>
- Date: Sun, 25 Mar 2012 11:12:35 -0500
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