The OpenD Programming Language

bernoulliCCDF

Computes the bernoulli complementary cumulative distribution function (CCDF).

@safe pure nothrow @nogc
T
bernoulliCCDF
(
T
)
(
const bool x
,
const T p
)
if (
isFloatingPoint!T
)

Parameters

x bool

value to evaluate CCDF

p T

true probability

Examples

import mir.math.common: approxEqual;

assert(true.bernoulliCCDF(0.5) == 0);
assert(false.bernoulliCCDF(0.5) == 0.5);

assert(true.bernoulliCCDF(0.7) == 0);
assert(false.bernoulliCCDF(0.7).approxEqual(0.7));

See Also

Meta