| 168 | |
| 169 | |
| 170 | static int math_min (lua_State *L) { |
| 171 | int n = lua_gettop(L); /* number of arguments */ |
| 172 | lua_Number dmin = luaL_checknumber(L, 1); |
| 173 | int i; |
| 174 | for (i=2; i<=n; i++) { |
| 175 | lua_Number d = luaL_checknumber(L, i); |
| 176 | if (d < dmin) |
| 177 | dmin = d; |
| 178 | } |
| 179 | lua_pushnumber(L, dmin); |
| 180 | return 1; |
| 181 | } |
| 182 | |
| 183 | |
| 184 | static int math_max (lua_State *L) { |
nothing calls this directly
no test coverage detected