mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 07:59:27 +02:00
Fix bug report 34320, about random returning two same values at start
git-svn-id: trunk@35259 -
This commit is contained in:
parent
729d582822
commit
d5f2c58d32
@ -643,10 +643,11 @@ begin
|
||||
OldRandSeed:=RandSeed;
|
||||
l_index:=MTWIST_N;
|
||||
end;
|
||||
if mt_index=MTWIST_N then
|
||||
if l_index=MTWIST_N then
|
||||
begin
|
||||
mtwist_update_state;
|
||||
l_index:=0;
|
||||
mt_index:=1;
|
||||
end;
|
||||
result:=mt_state[l_index];
|
||||
result:=result xor (result shr 11);
|
||||
|
Loading…
Reference in New Issue
Block a user