MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / luaopen_math

Function luaopen_math

lib/lua/src/lmathlib.c:768–780  ·  view source on GitHub ↗

** Open math library */

Source from the content-addressed store, hash-verified

766** Open math library
767*/
768LUAMOD_API int luaopen_math (lua_State *L) {
769 luaL_newlib(L, mathlib);
770 lua_pushnumber(L, PI);
771 lua_setfield(L, -2, "pi");
772 lua_pushnumber(L, (lua_Number)HUGE_VAL);
773 lua_setfield(L, -2, "huge");
774 lua_pushinteger(L, LUA_MAXINTEGER);
775 lua_setfield(L, -2, "maxinteger");
776 lua_pushinteger(L, LUA_MININTEGER);
777 lua_setfield(L, -2, "mininteger");
778 setrandfunc(L);
779 return 1;
780}
781

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