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

Function nextrand

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

Source from the content-addressed store, hash-verified

346}
347
348static Rand64 nextrand (Rand64 *state) {
349 Rand64 state0 = state[0];
350 Rand64 state1 = state[1];
351 Rand64 state2 = state[2] ^ state0;
352 Rand64 state3 = state[3] ^ state1;
353 Rand64 res = rotl(state1 * 5, 7) * 9;
354 state[0] = state0 ^ state3;
355 state[1] = state1 ^ state2;
356 state[2] = state2 ^ (state1 << 17);
357 state[3] = rotl(state3, 45);
358 return res;
359}
360
361
362/*

Callers 4

projectFunction · 0.70
math_randomFunction · 0.70
setseedFunction · 0.70
math_randomseedFunction · 0.70

Calls 6

rotlFunction · 0.70
times9Function · 0.70
times5Function · 0.70
IshlFunction · 0.70
IxorFunction · 0.70
rotl1Function · 0.70

Tested by

no test coverage detected