[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 22:48:44 +0200
2013/9/8 Coda Highland <chighland@gmail.com>:
> while tostring(tonumber(x)) can't be a guaranteed round-trip,
> tonumber(tostring(x)) CAN be, by making tostring() output enough
> digits.
For a certain meaning of "enough", yes. Is "enough" 17 digits,
though? Interesting but decidedly non-trivial question!
- 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