MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / setseed

Function setseed

3rd/lua-5.4.3/src/lmathlib.c:592–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

590
591
592static void setseed (lua_State *L, Rand64 *state,
593 lua_Unsigned n1, lua_Unsigned n2) {
594 int i;
595 state[0] = Int2I(n1);
596 state[1] = Int2I(0xff); /* avoid a zero state */
597 state[2] = Int2I(n2);
598 state[3] = Int2I(0);
599 for (i = 0; i < 16; i++)
600 nextrand(state); /* discard initial values to "spread" seed */
601 lua_pushinteger(L, n1);
602 lua_pushinteger(L, n2);
603}
604
605
606/*

Callers 2

randseedFunction · 0.85
math_randomseedFunction · 0.85

Calls 3

Int2IFunction · 0.85
nextrandFunction · 0.85
lua_pushintegerFunction · 0.85

Tested by

no test coverage detected