MCPcopy Create free account
hub / github.com/PlutoLang/Pluto / luaopen_math

Function luaopen_math

src/lmathlib.cpp:846–860  ·  view source on GitHub ↗

** Open math library */

Source from the content-addressed store, hash-verified

844** Open math library
845*/
846LUAMOD_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

Callers

nothing calls this directly

Calls 4

lua_pushnumberFunction · 0.85
lua_setfieldFunction · 0.85
lua_pushintegerFunction · 0.85
setrandfuncFunction · 0.85

Tested by

no test coverage detected