[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: What am I doing wrong with tonumber?
- From: Tim Channon <tc@...>
- Date: Tue, 15 May 2012 16:36:45 +0100
I don't understand what is going on here with 5.1
Anyone else get this?
This script
s='7' print(tonumber(s), s)
s='aa' print(tonumber(s), s)
s='na' print(tonumber(s), s)
s='nan' print(tonumber(s), s)
s='n' print(tonumber(s), s)
s='nb' print(tonumber(s), s)
s='v' print(tonumber(s), s)
s='va' print(tonumber(s), s)
Produces
7 7
nil aa
0 na
nan nan
0 n
nil nb
nil v
nil va