src/Malenki/Math/RandomComplex.php
protected static function random($float_min, $float_max)
    {

        if ($float_max >= 0) {
            $r = new Random();

            while (true) {
                $float_prov = $float_max * $r->get();

                if ($float_prov >= $float_min) {
                    return $float_prov;
                }
            }
        } else {
            $r = new Random();

            while (true) {
                $float_prov = $float_min * $r->get();

                if ($float_prov <= $float_max) {
                    return $float_prov;
                }
            }
        }
    }
protected static function random($float_min, $float_max)
    {

        if ($float_max >= 0) {
            $r = new Random();

            while (true) {
                $float_prov = $float_max * $r->get();

                if ($float_prov >= $float_min) {
                    return $float_prov;
                }
            }
        } else {
            $r = new Random();

            while (true) {
                $float_prov = $float_min * $r->get();

                if ($float_prov <= $float_max) {
                    return $float_prov;
                }
            }
        }
    }
Gets a random float numbers inside the given range.

@param  float $float_min Minimal float value allowed
@param  mixed $float_max Maximal float value allowed
@static
@access protected
@return float