lua-users home
lua-l archive

Re: why tostring for number use LUA_NUMBER_FMT "%.14g", not "%.16g" ?

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


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?

AltStyle によって変換されたページ (->オリジナル) /