MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / luaopen_math

Function luaopen_math

deps/lua/src/lmathlib.c:251–262  ·  view source on GitHub ↗

** Open math library */

Source from the content-addressed store, hash-verified

249** Open math library
250*/
251LUALIB_API int luaopen_math (lua_State *L) {
252 luaL_register(L, LUA_MATHLIBNAME, mathlib);
253 lua_pushnumber(L, PI);
254 lua_setfield(L, -2, "pi");
255 lua_pushnumber(L, HUGE_VAL);
256 lua_setfield(L, -2, "huge");
257#if defined(LUA_COMPAT_MOD)
258 lua_getfield(L, -1, "fmod");
259 lua_setfield(L, -2, "mod");
260#endif
261 return 1;
262}
263

Callers

nothing calls this directly

Calls 3

lua_pushnumberFunction · 0.85
lua_setfieldFunction · 0.85
lua_getfieldFunction · 0.85

Tested by

no test coverage detected