The OpenD Programming Language

uniformDiscreteCCDF

Computes the discrete uniform complementary cumulative distribution function (CCDF).

@safe pure nothrow @nogc
double
uniformDiscreteCCDF
(
const size_t x
,
const size_t lower = 0
,
const size_t upper = 1
)

Parameters

x size_t

value to evaluate CCDF

lower size_t

lower bound

upper size_t

upper bound

Examples

import mir.test: shouldApprox;

0.uniformDiscreteCCDF.shouldApprox == 0.5;
1.uniformDiscreteCCDF.shouldApprox == 0.0;

1.uniformDiscreteCCDF(1, 3).shouldApprox == 2.0 / 3;
2.uniformDiscreteCCDF(1, 3).shouldApprox == 1.0 / 3;
3.uniformDiscreteCCDF(1, 3).shouldApprox == 0.0;

See Also

Meta