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

Function setrandfunc

lib/lua/src/lmathlib.c:659–664  ·  view source on GitHub ↗

** Register the random functions and initialize their state. */

Source from the content-addressed store, hash-verified

657** Register the random functions and initialize their state.
658*/
659static void setrandfunc (lua_State *L) {
660 RanState *state = (RanState *)lua_newuserdatauv(L, sizeof(RanState), 0);
661 randseed(L, state); /* initialize with a "random" seed */
662 lua_pop(L, 2); /* remove pushed seeds */
663 luaL_setfuncs(L, randfuncs, 1);
664}
665
666/* }================================================================== */
667

Callers 1

luaopen_mathFunction · 0.85

Calls 3

lua_newuserdatauvFunction · 0.85
randseedFunction · 0.85
luaL_setfuncsFunction · 0.85

Tested by

no test coverage detected