MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / math_max

Function math_max

ThirdParty/lua/lua/lmathlib.c:223–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221
222
223static int math_max (lua_State *L) {
224 int n = lua_gettop(L); /* number of arguments */
225 int imax = 1; /* index of current maximum value */
226 int i;
227 luaL_argcheck(L, n >= 1, 1, "value expected");
228 for (i = 2; i <= n; i++) {
229 if (lua_compare(L, imax, i, LUA_OPLT))
230 imax = i;
231 }
232 lua_pushvalue(L, imax);
233 return 1;
234}
235
236/*
237** This function uses 'double' (instead of 'lua_Number') to ensure that

Callers

nothing calls this directly

Calls 3

lua_gettopFunction · 0.85
lua_compareFunction · 0.85
lua_pushvalueFunction · 0.85

Tested by

no test coverage detected