An elegant way to return random float between two numbers:
example:
<?php
function random_float ($min,$max) {
return ($min+lcg_value()*(abs($max-$min)));
}
?>
<?php
function random_float ($min,$max) {
return max($min, lcg_value() * $max);
}
?>
Sunday, December 16, 2007
Return Random Float
POSTED BY
Oriol
AT
12:12 AM