MCPcopy Create free account
hub / github.com/defold/defold / luaL_checknumber

Function luaL_checknumber

engine/lua/src/lua/lauxlib.c:176–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174
175
176LUALIB_API lua_Number luaL_checknumber (lua_State *L, int narg) {
177 lua_Number d = lua_tonumber(L, narg);
178 if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */
179 tag_error(L, narg, LUA_TNUMBER);
180 return d;
181}
182
183
184LUALIB_API lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number def) {

Callers 15

Script_SetScaleFunction · 0.85
Script_SetScaleXYFunction · 0.85
Script_AnimateFunction · 0.85
Sys_GetConfigNumberFunction · 0.85
LuaValueToDDFFunction · 0.85
Vector_newindexFunction · 0.85
Vector3_newindexFunction · 0.85
Vector3_mulFunction · 0.85
Vector3_divFunction · 0.85
Vector4_newindexFunction · 0.85
Vector4_mulFunction · 0.85
Vector4_divFunction · 0.85

Calls 3

lua_tonumberFunction · 0.85
lua_isnumberFunction · 0.85
tag_errorFunction · 0.85

Tested by 2

ParseTruncatedTableFunction · 0.68
CallbackCounterFunction · 0.68