MCPcopy Create free account
hub / github.com/Tencent/xLua / luaopen_math

Function luaopen_math

WebGLPlugins/lmathlib.c:394–405  ·  view source on GitHub ↗

** Open math library */

Source from the content-addressed store, hash-verified

392** Open math library
393*/
394LUAMOD_API int luaopen_math (lua_State *L) {
395 luaL_newlib(L, mathlib);
396 lua_pushnumber(L, PI);
397 lua_setfield(L, -2, "pi");
398 lua_pushnumber(L, (lua_Number)HUGE_VAL);
399 lua_setfield(L, -2, "huge");
400 lua_pushinteger(L, LUA_MAXINTEGER);
401 lua_setfield(L, -2, "maxinteger");
402 lua_pushinteger(L, LUA_MININTEGER);
403 lua_setfield(L, -2, "mininteger");
404 return 1;
405}
406

Callers

nothing calls this directly

Calls 3

lua_pushnumberFunction · 0.85
lua_setfieldFunction · 0.85
lua_pushintegerFunction · 0.85

Tested by

no test coverage detected