The OpenD Programming Language

uniformPDF

Computes the uniform probability density function (PDF).

@safe pure nothrow @nogc
T
uniformPDF
(
T
)
(
const T x
,
const T lower = 0
,
const T upper = 1
)
if (
isFloatingPoint!T
)

Parameters

x T

value to evaluate PDF

lower T

lower bound

upper T

upper bound

Examples

import mir.math.common: approxEqual;
assert(0.5.uniformPDF == 1);
assert(0.5.uniformPDF(0.0, 1.5).approxEqual(2.0 / 3));
assert(2.5.uniformPDF(1.0, 3.0).approxEqual(0.5));

See Also

Meta