MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / math_max

Function math_max

lib/lua/src/lmathlib.c:220–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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