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

Function setseed

third-party/lua-5.5.0/src/lmathlib.c:617–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

615
616
617static void setseed (lua_State *L, Rand64 *state,
618 lua_Unsigned n1, lua_Unsigned n2) {
619 int i;
620 state[0] = Int2I(n1);
621 state[1] = Int2I(0xff); /* avoid a zero state */
622 state[2] = Int2I(n2);
623 state[3] = Int2I(0);
624 for (i = 0; i < 16; i++)
625 nextrand(state); /* discard initial values to "spread" seed */
626 lua_pushinteger(L, l_castU2S(n1));
627 lua_pushinteger(L, l_castU2S(n2));
628}
629
630
631static int math_randomseed (lua_State *L) {

Callers 2

math_randomseedFunction · 0.70
setrandfuncFunction · 0.70

Calls 3

Int2IFunction · 0.70
nextrandFunction · 0.70
lua_pushintegerFunction · 0.70

Tested by

no test coverage detected