Skip to content

Commit

Permalink
Fix #123.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Oct 4, 2019
1 parent 36c6ee3 commit 35f9d72
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/quantile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import ascending from "./ascending.js";
import number, {numbers} from "./number.js";

export default function quantile(values, p, valueof) {
return quantileSorted(Float64Array.from(numbers(values, valueof)).sort(ascending), p);
values = Float64Array.from(numbers(values, valueof));
values.sort(ascending);
return quantileSorted(values, p);
}

export function quantileSorted(values, p, valueof = number) {
Expand Down

0 comments on commit 35f9d72

Please sign in to comment.