[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: why tostring for number use LUA_NUMBER_FMT "%.14g", not "%.16g" ?
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sun, 8 Sep 2013 23:33:49 +0200
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?
- References:
- why tostring for number use LUA_NUMBER_FMT "%.14g", not "%.16g" ?, pulleyzzz_gmail
- Re: why tostring for number use LUA_NUMBER_FMT "%.14g", not "%.16g" ?, Leo Razoumov
- Re: why tostring for number use LUA_NUMBER_FMT "%.14g", not "%.16g" ?, Coda Highland
- Re: why tostring for number use LUA_NUMBER_FMT "%.14g", not "%.16g" ?, Dirk Laurie
- Re: why tostring for number use LUA_NUMBER_FMT "%.14g", not "%.16g" ?, Coda Highland
- Re: why tostring for number use LUA_NUMBER_FMT "%.14g", not "%.16g" ?, Dirk Laurie
- Re: why tostring for number use LUA_NUMBER_FMT "%.14g", not "%.16g" ?, Coda Highland