Distribution.percentValue

Gets the value which X% of the values in the list are less than or equal to.

For example, if values contains [1, 2, 3, 4, 5, 6, 7, 8], then percentValue(0.5) returns 4, while percentValue(0.25) returns 2, and percentValue(1.0) returns 8.

Throws an error if passed a value <= 0 or >= 1.

class Distribution(T)
T
percentValue
(
double fraction
)
out (result) { if (this.values.length == 0) { assert (result == 0, "percentValue should be 0 for empty distributions"); } }

Parameters

fraction double

percentage as a fraction

Return Value

Type: T

value which X% of the values in the list are less than or equal to

Meta