[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Lua 5.3.0 (rc1) now available
- From: Tomas Guisasola Gorham <tomas@...>
- Date: Thu, 18 Dec 2014 10:37:17 -0200 (BRST)
That certainly would help, but an essential point is to understand how
you *want* to round these values.
This is a good question.
Since 2.7 "has no integer representation", I could think that
'2' also hasn't. But that is not what happens:
Lua 5.3.0 Copyright (C) 1994-2014 Lua.org, PUC-Rio
return string.format("%d", '2.7')
stdin:1: bad argument #2 to 'format' (number has no integer representation)
[C]: in function 'string.format'
stdin:1: in main chunk
[C]: in ?
return string.format("%d", '2')
return string.format("%d", '2.0')
What is the rationale? Are you considering a change on automatic
coercion? It will probably produce a great compatibility problem but
it may be worth it...