ID: 46587
Updated by: [EMAIL PROTECTED]
Reported By: atomo64 at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: *Math Functions
Operating System: Debian sid
PHP Version: 5.2.6
-Assigned To:
+Assigned To: pajoye
Previous Comments:
------------------------------------------------------------------------
[2008-11-17 02:50:20] atomo64 at gmail dot com
Description:
------------
Whenever min is set to 0 and max is set to anything greater than
getrandmax (or the mt_ version) the returned PRN is always (despite
the upper limit check in the example code) a number minor than 0.
Reproduce code:
---------------
define("UL", mt_getrandmax()+1000);
$r=mt_rand(0, UL);
if ($r < 0 || $r > UL)
echo "Random value out of range\n";
Expected result:
----------------
No output
Actual result:
--------------
Random value out of range
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46587&edit=1