Skip to content

Commit

Permalink
Update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Sep 19, 2021
1 parent 4c8bbf9 commit 6383dc8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/stats/outliers_logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ const findQuantileIndex = function (quantiles, medianIndex, quantileIndex) {
for (let index = quantileIndex + 1; index < medianIndex; index += 1) {
const quantile = quantiles[index]

// The quantiles computation can have rounding errors leading some quantiles
// very close to each other (difference close to `Number.EPSILON`) to be
// sorted in the wrong order. This can lead to negative `quantile - median`
// `max === quantile` happens when several consecutive quantiles have the
// same value which happens when a specific measure is repeated many times.
// `max < quantile` happens when the quantiles computation has rounding
// errors leading some quantiles very close to each other (difference close
// to `Number.EPSILON`) to be sorted in the wrong order.
// eslint-disable-next-line max-depth
if (max <= quantile) {
return
Expand Down

0 comments on commit 6383dc8

Please sign in to comment.