1
0
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:
Daniil Gentili 2022-05-22 14:28:02 +02:00
parent 58240aeb22
commit 0d5006daf0
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -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++) {