| 232 | |
| 233 | |
| 234 | static int math_min (lua_State *L) { |
| 235 | int n = lua_gettop(L); /* number of arguments */ |
| 236 | int imin = 1; /* index of current minimum value */ |
| 237 | int i; |
| 238 | luaL_argcheck(L, n >= 1, 1, "value expected"); |
| 239 | for (i = 2; i <= n; i++) { |
| 240 | if (lua_compare(L, i, imin, LUA_OPLT)) |
| 241 | imin = i; |
| 242 | } |
| 243 | lua_pushvalue(L, imin); |
| 244 | return 1; |
| 245 | } |
| 246 | |
| 247 | |
| 248 | static int math_max (lua_State *L) { |
nothing calls this directly
no test coverage detected