Bug #71152 [Opn->Csd]: mt_rand() returns the different values from original mt19937ar.c
Edit report at https://bugs.php.net/bug.php?id=71152&edit=1
ID: 71152
Updated by: laruence@php.net
Reported by: kusano4a at gmail dot com
Summary: mt_rand() returns the different values from original
mt19937ar.c
-Status: Open
+Status: Closed
Type: Bug
Package: *Math Functions
Operating System: All
PHP Version: master-Git-2015-12-17 (Git)
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of kusano@users.noreply.github.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=6f6bd8ce531636134efd5f669a4e8373fb2e9e51
Log: Fix #71152: mt_rand() returns the different values from original mt19937ar.c
Previous Comments:
------------------------------------------------------------------------
[2015-12-17 19:13:25] kusano4a at gmail dot com
Description:
------------
mt_rand() returns the different values from original mt19937ar.c.
Although mt_rand() is required to be generate random numbers, I am concerned about that this
difference implies possibly deterioration of randomness quality.
Test script:
---------------
<?php
mt_srand(12345678);
for ($i=0; $i<10; $i++)
echo mt_rand().PHP_EOL;
Expected result:
----------------
527860569
1711027313
1280820687
688176834
770499160
412773096
813703253
898651287
52508912
757323740
Actual result:
--------------
1614640687
1711027313
857485497
688176834
1386682158
412773096
813703253
898651287
2087374214
1382556330
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71152&edit=1
Thread (4 messages)