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

Function math_max

extlibs/lua/src/lmathlib.c:219–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217
218
219static int math_max (lua_State *L) {
220 int n = lua_gettop(L); /* number of arguments */
221 int imax = 1; /* index of current maximum value */
222 int i;
223 luaL_argcheck(L, n >= 1, 1, "value expected");
224 for (i = 2; i <= n; i++) {
225 if (lua_compare(L, imax, i, LUA_OPLT))
226 imax = i;
227 }
228 lua_pushvalue(L, imax);
229 return 1;
230}
231
232
233static int math_type (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