MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / luaopen_math

Function luaopen_math

xrepo/packages/l/lua/port/lua/src/lmathlib.c:751–763  ·  view source on GitHub ↗

** Open math library */

Source from the content-addressed store, hash-verified

749** Open math library
750*/
751LUAMOD_API int luaopen_math (lua_State *L) {
752 luaL_newlib(L, mathlib);
753 lua_pushnumber(L, PI);
754 lua_setfield(L, -2, "pi");
755 lua_pushnumber(L, (lua_Number)HUGE_VAL);
756 lua_setfield(L, -2, "huge");
757 lua_pushinteger(L, LUA_MAXINTEGER);
758 lua_setfield(L, -2, "maxinteger");
759 lua_pushinteger(L, LUA_MININTEGER);
760 lua_setfield(L, -2, "mininteger");
761 setrandfunc(L);
762 return 1;
763}
764

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected