| 615 | |
| 616 | |
| 617 | static void setseed (lua_State *L, Rand64 *state, |
| 618 | lua_Unsigned n1, lua_Unsigned n2) { |
| 619 | int i; |
| 620 | state[0] = Int2I(n1); |
| 621 | state[1] = Int2I(0xff); /* avoid a zero state */ |
| 622 | state[2] = Int2I(n2); |
| 623 | state[3] = Int2I(0); |
| 624 | for (i = 0; i < 16; i++) |
| 625 | nextrand(state); /* discard initial values to "spread" seed */ |
| 626 | lua_pushinteger(L, l_castU2S(n1)); |
| 627 | lua_pushinteger(L, l_castU2S(n2)); |
| 628 | } |
| 629 | |
| 630 | |
| 631 | static int math_randomseed (lua_State *L) { |
no test coverage detected