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

Function math_min

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

Source from the content-addressed store, hash-verified

209
210
211static int math_min(lua_State *L) {
212 int n = lua_gettop(L); /* number of arguments */
213 int imin = 1; /* index of current minimum value */
214 int i;
215 luaL_argcheck(L, n >= 1, 1, "value expected");
216 for (i = 2; i <= n; i++) {
217 if (lua_compare(L, i, imin, LUA_OPLT))
218 imin = i;
219 }
220 lua_pushvalue(L, imin);
221 return 1;
222}
223
224
225static int math_max(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