Hi,
Lua 5.3.0 Copyright (C) 1994-2015 Lua.org, PUC-Rio
First, here are some bits from the manual:
so working backwards:
0 and 1 both get parsed by the lexer as integers.
> print(0+1)
1
> print(math.type(0+1))
integer
tonumber() also parses "0" to an integer:
> print(tonumber("0")+1)
1
> print(math.type(tonumber("0")+1))
integer
yet without the explicit conversion it ends up as a float:
> print("0"+1)
1.0
> print(math.type("0"+1))
float