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

Function math_type

depends/lua/src/lmathlib.c:284–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282
283
284static int math_type (lua_State *L) {
285 if (lua_type(L, 1) == LUA_TNUMBER) {
286 if (lua_isinteger(L, 1))
287 lua_pushliteral(L, "integer");
288 else
289 lua_pushliteral(L, "float");
290 }
291 else {
292 luaL_checkany(L, 1);
293 lua_pushnil(L);
294 }
295 return 1;
296}
297
298
299/*

Callers

nothing calls this directly

Calls 4

lua_typeFunction · 0.85
lua_isintegerFunction · 0.85
luaL_checkanyFunction · 0.85
lua_pushnilFunction · 0.85

Tested by

no test coverage detected