dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0dba772
)
fixed weird composite random number function
author
Tim Starling
<tstarling@users.mediawiki.org>
Sat, 7 May 2005 11:01:26 +0000
(11:01 +0000)
committer
Tim Starling
<tstarling@users.mediawiki.org>
Sat, 7 May 2005 11:01:26 +0000
(11:01 +0000)
includes/GlobalFunctions.php
patch
|
blob
|
history
diff --git
a/includes/GlobalFunctions.php
b/includes/GlobalFunctions.php
index
6234ecc
..
ccc42f8
100644
(file)
--- 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;
}