| 246 | |
| 247 | |
| 248 | static int math_max (lua_State *L) { |
| 249 | int n = lua_gettop(L); /* number of arguments */ |
| 250 | int imax = 1; /* index of current maximum value */ |
| 251 | int i; |
| 252 | luaL_argcheck(L, n >= 1, 1, "value expected"); |
| 253 | for (i = 2; i <= n; i++) { |
| 254 | if (lua_compare(L, imax, i, LUA_OPLT)) |
| 255 | imax = i; |
| 256 | } |
| 257 | lua_pushvalue(L, imax); |
| 258 | return 1; |
| 259 | } |
| 260 | |
| 261 | |
| 262 | static int math_type (lua_State *L) { |
nothing calls this directly
no test coverage detected