| 203 | |
| 204 | |
| 205 | static int math_min (lua_State *L) { |
| 206 | int n = lua_gettop(L); /* number of arguments */ |
| 207 | int imin = 1; /* index of current minimum value */ |
| 208 | int i; |
| 209 | luaL_argcheck(L, n >= 1, 1, "value expected"); |
| 210 | for (i = 2; i <= n; i++) { |
| 211 | if (lua_compare(L, i, imin, LUA_OPLT)) |
| 212 | imin = i; |
| 213 | } |
| 214 | lua_pushvalue(L, imin); |
| 215 | return 1; |
| 216 | } |
| 217 | |
| 218 | |
| 219 | static int math_max (lua_State *L) { |
nothing calls this directly
no test coverage detected