MCPcopy Create free account
hub / github.com/DFHack/dfhack / lua_tonumberx

Function lua_tonumberx

depends/lua/src/lapi.c:345–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343
344
345LUA_API lua_Number lua_tonumberx (lua_State *L, int idx, int *pisnum) {
346 lua_Number n;
347 const TValue *o = index2addr(L, idx);
348 int isnum = tonumber(o, &n);
349 if (!isnum)
350 n = 0; /* call to 'tonumber' may change 'n' even if it fails */
351 if (pisnum) *pisnum = isnum;
352 return n;
353}
354
355
356LUA_API lua_Integer lua_tointegerx (lua_State *L, int idx, int *pisnum) {

Callers 1

luaL_checknumberFunction · 0.85

Calls 1

index2addrFunction · 0.85

Tested by

no test coverage detected