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

Function nextrand

third-party/lua-5.4.6/src/lmathlib.c:320–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318}
319
320static Rand64 nextrand (Rand64 *state) {
321 Rand64 state0 = state[0];
322 Rand64 state1 = state[1];
323 Rand64 state2 = state[2] ^ state0;
324 Rand64 state3 = state[3] ^ state1;
325 Rand64 res = rotl(state1 * 5, 7) * 9;
326 state[0] = state0 ^ state3;
327 state[1] = state1 ^ state2;
328 state[2] = state2 ^ (state1 << 17);
329 state[3] = rotl(state3, 45);
330 return res;
331}
332
333
334/*

Callers 3

projectFunction · 0.70
math_randomFunction · 0.70
setseedFunction · 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