From: Tim Starling Date: Sat, 7 May 2005 11:01:26 +0000 (+0000) Subject: fixed weird composite random number function X-Git-Tag: 1.5.0alpha2~275 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=133b12c9dc98e4f1abe5a1ccb3138612f3837176;p=lhc%2Fweb%2Fwiklou.git fixed weird composite random number function --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 6234ecc8d7..ccc42f8991 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -162,7 +162,7 @@ function wfRandom() { # The maximum random value is "only" 2^31-1, so get two random # values to reduce the chance of dupes $max = mt_getrandmax(); - $rand = number_format( mt_rand() * mt_rand() + $rand = number_format( (mt_rand() * max + mt_rand()) / $max / $max, 12, '.', '' ); return $rand; }