** Open math library */
| 844 | ** Open math library |
| 845 | */ |
| 846 | LUAMOD_API int luaopen_math (lua_State *L) { |
| 847 | luaL_newlib(L, mathlib); |
| 848 | lua_pushnumber(L, PI); |
| 849 | lua_setfield(L, -2, "pi"); |
| 850 | lua_pushnumber(L, (lua_Number)HUGE_VAL); |
| 851 | lua_setfield(L, -2, "huge"); |
| 852 | lua_pushnumber(L, (lua_Number)HUGE_VAL); |
| 853 | lua_setfield(L, -2, "inf"); |
| 854 | lua_pushinteger(L, LUA_MAXINTEGER); |
| 855 | lua_setfield(L, -2, "maxinteger"); |
| 856 | lua_pushinteger(L, LUA_MININTEGER); |
| 857 | lua_setfield(L, -2, "mininteger"); |
| 858 | setrandfunc(L); |
| 859 | return 1; |
| 860 | } |
| 861 |
nothing calls this directly
no test coverage detected