MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / math_min

Function math_min

extlibs/lua/src/lmathlib.c:205–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203
204
205static int math_min (lua_State *L) {
206 int n = lua_gettop(L); /* number of arguments */
207 int imin = 1; /* index of current minimum value */
208 int i;
209 luaL_argcheck(L, n >= 1, 1, "value expected");
210 for (i = 2; i <= n; i++) {
211 if (lua_compare(L, i, imin, LUA_OPLT))
212 imin = i;
213 }
214 lua_pushvalue(L, imin);
215 return 1;
216}
217
218
219static int math_max (lua_State *L) {

Callers

nothing calls this directly

Calls 3

lua_gettopFunction · 0.85
lua_pushvalueFunction · 0.85
lua_compareFunction · 0.70

Tested by

no test coverage detected