Last modified: 2006-12-11 21:09:59 UTC
wfRandom returns a value greater than 1 with a probability of ~2^-31 (if mt_getrandmax == 2^31-1). I don't think that will cause any problems, but a comment in the code says the value should be between 0 and 1. Here is a "correct" version of the function: 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() + 1; $rand = number_format( (mt_rand() * $max + mt_rand()) / $max / $max, 12, '.', '' ); return $rand; }
Fixed in r18271