[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: Tue, 10 Sep 2013 10:41:04 +0200
2013/9/9 Tim Hill <drtimhill@gmail.com>:
> On Sep 9, 2013, at 6:02 AM, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>
>> Well, we do not. We could debate whether tostring{} -> 0x83ffda8 or even
>> tostring("123") is CORRECT. Anyway, the manual is very clear about it:
>>
>> "Receives an argument of any type and converts it to a string in a
>> reasonable format."
>>
>> The key word there is *reasonable*.
>>
>> -- Roberto
>>
>
> People will of course argue what "reasonable" means :)
The key sentence in Roberto's e-mail is 'Well, we do not.', which was
in response to the answer "Yes, I think we do." in reply to the question
'Do we really want "tostring(0.1)" to return "0.10000000000000001"?'
I.e. the Lua team is not going to change the default output format,
no matter how long this thread goes on.
Signing off,
Dirk
- 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
- Re: why tostring for number use LUA_NUMBER_FMT "%.14g", not "%.16g" ?, Roberto Ierusalimschy
- Re: why tostring for number use LUA_NUMBER_FMT "%.14g", not "%.16g" ?, Tim Hill