Calculate the random value between two float numbers.
/**
* Calculate the random value between two float numbers.
* @param float $min Minimum float range value
* @param float $max Maximum float range value
* @return float Random Float value
*/
public function random_float ( $min, $max ) {
return ( $min + lcg_value() * ( abs ( $max - $min ) ) );
}
|
No comments:
Post a Comment
Please post any queries and comments here.