Quantiles are computed using an empirical distribution function with
averaging. For the $q$th quantile of a set of $n$ ordered measurement
values $(x_1, x_2,...,x_n)$, the product of $nq$ can be written as: $nq = j
+ g$, where $j$ is the integer part and $g$ is the fractional part of $nq$.
The value of the $q$th quantile, $y$, is given by $(x_j + x_{j+1}) / 2$ when $g$
is zero, or by $x_{j+1}$ when $g$ is greater than zero.