MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / randseed

Function randseed

lib/lua/src/lmathlib.c:628–632  ·  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

626** randomization).
627*/
628static void randseed (lua_State *L, RanState *state) {
629 lua_Unsigned seed1 = (lua_Unsigned)time(NULL);
630 lua_Unsigned seed2 = (lua_Unsigned)(size_t)L;
631 setseed(L, state->s, seed1, seed2);
632}
633
634
635static 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