MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / math_randomseed

Function math_randomseed

extlibs/lua/src/lmathlib.c:617–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

615
616
617static int math_randomseed (lua_State *L) {
618 RanState *state = (RanState *)lua_touserdata(L, lua_upvalueindex(1));
619 if (lua_isnone(L, 1)) {
620 randseed(L, state);
621 }
622 else {
623 lua_Integer n1 = luaL_checkinteger(L, 1);
624 lua_Integer n2 = luaL_optinteger(L, 2, 0);
625 setseed(L, state->s, n1, n2);
626 }
627 return 2; /* return seeds */
628}
629
630
631static const luaL_Reg randfuncs[] = {

Callers

nothing calls this directly

Calls 5

lua_touserdataFunction · 0.85
randseedFunction · 0.85
luaL_checkintegerFunction · 0.85
luaL_optintegerFunction · 0.85
setseedFunction · 0.85

Tested by

no test coverage detected