| 182 | |
| 183 | |
| 184 | static int math_max (lua_State *L) { |
| 185 | int n = lua_gettop(L); /* number of arguments */ |
| 186 | lua_Number dmax = luaL_checknumber(L, 1); |
| 187 | int i; |
| 188 | for (i=2; i<=n; i++) { |
| 189 | lua_Number d = luaL_checknumber(L, i); |
| 190 | if (d > dmax) |
| 191 | dmax = d; |
| 192 | } |
| 193 | lua_pushnumber(L, dmax); |
| 194 | return 1; |
| 195 | } |
| 196 | |
| 197 | |
| 198 | static int math_random (lua_State *L) { |
nothing calls this directly
no test coverage detected