Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/glacials/splits-io. a speedrunning data store and analysis engine splits.io
Something went wrong. Try again.
1234567891011121314const quantile = (arr, q) => { const sorted = arr.sort((a, b) => a - b) const pos = ((sorted.length) - 1) * q const base = Math.floor(pos) const rest = pos - base if ((sorted[base + 1] !== undefined)) { return sorted[base] + rest * (sorted[base + 1] - sorted[base]) } else { return sorted[base] }}
export {quantile}