double BernoulliCDF(int x, double p);
Bernoulli cumulative distribution function (CDF).
| # | Name | Type | Description |
|---|---|---|---|
| 1 | x | int | Function domain, integer; valid values are 0 or 1. |
| 2 | p | double | Success probability, real value on the closed interval [0,1]. |
Returns: the Bernoulli cumulative distribution function (CDF). Returns NAN when p is outside [0,1] or x is negative.
Remarks:
Computes the Bernoulli CDF P(X <= x):
CDF(x| p)={ 1-p, if x=0
{ 1, if x >= 1
Domain: p in [0,1]. For x<0 or p not in [0,1] the result is NaN. Note that the implementation returns 1 for every x >= 1 (e.g. x=5), not only x=1.
Declared in Dew::Math::Units::Probabilities · Dew.Math/Units.Probabilities.h · Cross-compiler