Skip to content

Commit

Permalink
adopt cbrt
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Apr 1, 2022
1 parent 2453265 commit a8429c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/threshold/scott.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import count from "../count.js";
import deviation from "../deviation.js";

export default function thresholdScott(values, min, max) {
return Math.ceil((max - min) / (3.49 * deviation(values) * Math.pow(count(values), -1 / 3)));
return Math.ceil((max - min) * Math.cbrt(count(values)) / (3.49 * deviation(values)));
}

0 comments on commit a8429c4

Please sign in to comment.