mirror of
https://github.com/danog/PrimeModule.git
synced 2024-11-26 20:34:37 +01:00
Avoid issues with getrandmax
This commit is contained in:
parent
58240aeb22
commit
0d5006daf0
@ -32,7 +32,7 @@ class PrimeModule
|
||||
$it = 0;
|
||||
for ($i = 0; $i < 3 || $it < 1000; $i++) {
|
||||
$t = ((rand(0, 127) & 15) + 17) % $what;
|
||||
$x = rand(0, 1 << 31) % ($what - 1) + 1;
|
||||
$x = (rand() % ($what - 1)) + 1;
|
||||
$y = $x;
|
||||
$lim = 1 << ($i + 18);
|
||||
for ($j = 1; $j <= $lim; $j++) {
|
||||
|
Loading…
Reference in New Issue
Block a user