cdf method
Implementation
@override
double cdf(double x) {
if (x < 0.0) {
return 0.0;
}
if (x > trials) {
return 1.0;
}
double result = 0.0;
double end = x.floorToDouble() + 1;
for (double i = 0.0; i < end; i++) {
final double current = math.binomialCoefficient(trials, i);
final double pows =
(math.pow(prob, i) * math.pow(1 - prob, trials - i)).toDouble();
result += current * pows;
}
return result;
}