lua-users home
lua-l archive

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


If you want a format for serialization, we could use hex floats[1]. Hex floats have binary-exact representations.

[1] http://gcc.gnu.org/onlinedocs/gcc/Hex-Floats.html


On Sun, Sep 8, 2013 at 6:33 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
2013/9/8 Coda Highland <chighland@gmail.com>:

>> Do we really want "tostring(0.1)" to return "0.10000000000000001"?
>
> Yes, I think we do. If you wanted something to LOOK pretty, instead of
> having it be CORRECT, you wouldn't use tostring() -- you'd be using
> print.format().

Who should be doing something non-default here? The person who knows
just enough Lua to script an extension to a game, or the person who knows
Lua backwards and forwards?