[INTERPRETER]
* BUG: Prevent the use of seed 0 for the random-number generator, by replacing it by -1 if Randomize 0 is requested. git-svn-id: svn://localhost/gambas/trunk@7426 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
297a3a6a15
commit
061bb35502
1 changed files with 3 additions and 0 deletions
|
@ -54,6 +54,9 @@ static void GFSR_init(uint seed)
|
||||||
int i = 0, j;
|
int i = 0, j;
|
||||||
uint t = seed;
|
uint t = seed;
|
||||||
|
|
||||||
|
if (t == 0)
|
||||||
|
t = (uint)-1;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
t ^= (t >> 5) ^ (t << 1);
|
t ^= (t >> 5) ^ (t << 1);
|
||||||
|
|
Loading…
Reference in a new issue