private function buildQuartile(
        Number $percentage,
        ColumnVector $dataset
    ): Number {
        $dimension = $dataset->dimension();

        if ($dimension->value() === 2) {
            return divide(
                add($dataset->get(0), $dataset->get(1)),
                2
            );
        } else if ($dimension->value() === 1) {
            return $dataset->get(0);
        }

        $index = (int) $dimension
            ->multiplyBy($percentage)
            ->round()
            ->value();

        return divide(
            add($dataset->get($index), $dataset->get($index - 1)),
            2
        );
    }