Addresses two panic cases within this crate and fixes the
percentiles()` function to return the correct results.
There's a wrapping math operation which occurs when calculating the
upper bound of the highest bucket when the histogram is configured
to cover the entired 64bit range. This is addressed by returning
the histogram's max value if the bucket is the last bucket.
Additionally, as reported in #25 we perform a bounds check after
we index into an array in the percentiles() function. This will
reliably cause a panic. However, there are also issues with the
returned results after correcting the panic condition.
Fixes the logic in the percentiles() function to both avoid
out of bounds access and return the correct results.
Addresses two panic cases within this crate and fixes the percentiles()` function to return the correct results.
There's a wrapping math operation which occurs when calculating the upper bound of the highest bucket when the histogram is configured to cover the entired 64bit range. This is addressed by returning the histogram's max value if the bucket is the last bucket.
Additionally, as reported in #25 we perform a bounds check after we index into an array in the
percentiles()
function. This will reliably cause a panic. However, there are also issues with the returned results after correcting the panic condition.Fixes the logic in the
percentiles()
function to both avoid out of bounds access and return the correct results.