| 209 | |
| 210 | |
| 211 | static 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 | |
| 225 | static int math_max(lua_State *L) { |
nothing calls this directly
no test coverage detected