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

Function randseed

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

** Set a "random" seed. To get some randomness, use the current time ** and the address of 'L' (in case the machine does address space layout ** randomization). */

Source from the content-addressed store, hash-verified

609** randomization).
610*/
611static void randseed (lua_State *L, RanState *state) {
612 lua_Unsigned seed1 = (lua_Unsigned)time(NULL);
613 lua_Unsigned seed2 = (lua_Unsigned)(size_t)L;
614 setseed(L, state->s, seed1, seed2);
615}
616
617
618static int math_randomseed (lua_State *L) {

Callers 2

math_randomseedFunction · 0.85
setrandfuncFunction · 0.85

Calls 1

setseedFunction · 0.85

Tested by

no test coverage detected