| 217 | |
| 218 | |
| 219 | static int math_max (lua_State *L) { |
| 220 | int n = lua_gettop(L); /* number of arguments */ |
| 221 | int imax = 1; /* index of current maximum value */ |
| 222 | int i; |
| 223 | luaL_argcheck(L, n >= 1, 1, "value expected"); |
| 224 | for (i = 2; i <= n; i++) { |
| 225 | if (lua_compare(L, imax, i, LUA_OPLT)) |
| 226 | imax = i; |
| 227 | } |
| 228 | lua_pushvalue(L, imax); |
| 229 | return 1; |
| 230 | } |
| 231 | |
| 232 | |
| 233 | static int math_type (lua_State *L) { |
nothing calls this directly
no test coverage detected