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

Function math_floor

depends/lua/src/lmathlib.c:105–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103
104
105static int math_floor (lua_State *L) {
106 if (lua_isinteger(L, 1))
107 lua_settop(L, 1); /* integer is its own floor */
108 else {
109 lua_Number d = l_mathop(floor)(luaL_checknumber(L, 1));
110 pushnumint(L, d);
111 }
112 return 1;
113}
114
115
116static int math_ceil (lua_State *L) {

Callers

nothing calls this directly

Calls 4

lua_isintegerFunction · 0.85
lua_settopFunction · 0.85
luaL_checknumberFunction · 0.85
pushnumintFunction · 0.85

Tested by

no test coverage detected