| 37 | |
| 38 | |
| 39 | static int math_abs (lua_State *L) { |
| 40 | if (lua_isinteger(L, 1)) { |
| 41 | lua_Integer n = lua_tointeger(L, 1); |
| 42 | if (n < 0) n = (lua_Integer)(0u - (lua_Unsigned)n); |
| 43 | lua_pushinteger(L, n); |
| 44 | } |
| 45 | else |
| 46 | lua_pushnumber(L, l_mathop(fabs)(luaL_checknumber(L, 1))); |
| 47 | return 1; |
| 48 | } |
| 49 | |
| 50 | static int math_sin (lua_State *L) { |
| 51 | lua_pushnumber(L, l_mathop(sin)(luaL_checknumber(L, 1))); |
nothing calls this directly
no test coverage detected