MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / math_max

Function math_max

src/Chain/libraries/glua/lmathlib.cpp:225–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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