lua-users home
lua-l archive

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


Where is it possible to read exactly how and when strings are converted to numbers?in Lua 5.3. So in some case a string integer becomes a float:

> "123" + 1
124.0
> math.abs("123")
123.0

while in some other cases no conversion is done:

> math.max("123", -2.3, 1)
attempt to compare string with number
stack traceback:
       [C]: in function 'math.max'
       stdin:1: in main chunk
       [C]: in ?

and this in the math module which sometimes does conversion?

Robert