MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / math_randomseed

Function math_randomseed

third-party/lua-5.4.6/src/lmathlib.c:635–646  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

633
634
635static int math_randomseed (lua_State *L) {
636 RanState *state = (RanState *)lua_touserdata(L, lua_upvalueindex(1));
637 if (lua_isnone(L, 1)) {
638 randseed(L, state);
639 }
640 else {
641 lua_Integer n1 = luaL_checkinteger(L, 1);
642 lua_Integer n2 = luaL_optinteger(L, 2, 0);
643 setseed(L, state->s, n1, n2);
644 }
645 return 2; /* return seeds */
646}
647
648
649static const luaL_Reg randfuncs[] = {

Callers

nothing calls this directly

Calls 6

lua_upvalueindexFunction · 0.85
randseedFunction · 0.85
lua_touserdataFunction · 0.70
luaL_checkintegerFunction · 0.70
luaL_optintegerFunction · 0.70
setseedFunction · 0.70

Tested by

no test coverage detected