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

Function pushnumint

depends/lua/src/lmathlib.c:96–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94
95
96static void pushnumint (lua_State *L, lua_Number d) {
97 lua_Integer n;
98 if (lua_numbertointeger(d, &n)) /* does 'd' fit in an integer? */
99 lua_pushinteger(L, n); /* result is integer */
100 else
101 lua_pushnumber(L, d); /* result is float */
102}
103
104
105static int math_floor (lua_State *L) {

Callers 3

math_floorFunction · 0.85
math_ceilFunction · 0.85
math_modfFunction · 0.85

Calls 2

lua_pushintegerFunction · 0.85
lua_pushnumberFunction · 0.85

Tested by

no test coverage detected