luaV_tonumber
function · lua · boundary
- Address
0x6f7c20· 81 bytes, up to0x6f7c70- Meaning
- Converts a number or a fully numeric string to a number, else null
- Confidence
- verified, proof two
- Finding
- ui/luastate#reading-numeric-arguments
Finding: Reading numeric arguments in ui: the Lua state, its library and C functions
lua_tonumber answers the number, or a string's value when it parses fully; for anything else,
an absent argument included, it answers 0.0 and never raises. lua_isnumber accepts exactly what
converts; lua_isstring accepts numbers and strings. Integers come from __ftol, truncating
toward zero. What a function does with a missing number is its own: some raise (SetAlpha), some
use a default (a colour's alpha of 1), and some return having done nothing (SetScrollFromBottom).
An argument count is checked by few functions, and exactly: SetMaxLetters raises unless it has two
values (self included) and stores 0 only when the second is not a number.
The derivation is in the doc.
Callers 5
- lua_isnumber lua
- lua_tonumber lua
- luaV_execute lua
- Arith lua
- luaG_aritherror lua
Callees 1
- luaO_str2d lua
Calls and jumps by a bare address, from tables/calls.tsv.