MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / luaV_tonumber

Function luaV_tonumber

deps/lua/src/lvm.c:35–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34
35const TValue *luaV_tonumber (const TValue *obj, TValue *n) {
36 lua_Number num;
37 if (ttisnumber(obj)) return obj;
38 if (ttisstring(obj) && luaO_str2d(svalue(obj), &num)) {
39 setnvalue(n, num);
40 return n;
41 }
42 else
43 return NULL;
44}
45
46
47int luaV_tostring (lua_State *L, StkId obj) {

Callers 2

ArithFunction · 0.85
luaG_aritherrorFunction · 0.85

Calls 1

luaO_str2dFunction · 0.85

Tested by

no test coverage detected