Skip to content

utils.ArrayUtils.Function.getQuantileNearestFromSortedArray

Christian d'Heureuse edited this page Jun 7, 2026 · 2 revisions

dsp-collection / utils/ArrayUtils / getQuantileNearestFromSortedArray

Function: getQuantileNearestFromSortedArray()

function getQuantileNearestFromSortedArray<T>(a, q): T | undefined;

Defined in: utils/ArrayUtils.ts:124

Returns a quantile value from a sorted array.

Uses the nearest-rank / nearest-neighbor method to select an array entry.

Type Parameters

T

T

Parameters

a

readonly T[]

A sorted array.

q

number

Quantile position in the range [0..1].

Returns

T | undefined

Clone this wiki locally