MathPHP\Probability\Distribution\Continuous\Uniform::CDF PHP Method

CDF() public static method

cdf = 0 for x < a x - a cdf = ----- for a ≤ x < b b - a cdf = 1 x ≥ b
public static CDF ( number $a, number $b, number $x )
$a number lower boundary of the distribution
$b number upper boundary of the distribution
$x number percentile
    public static function CDF($a, $b, $x)
    {
        if ($x < $a) {
            return 0;
        }
        if ($x >= $b) {
            return 1;
        }
        return ($x - $a) / ($b - $a);
    }