HdrHistogram / hdrhistogram-go

A pure Go implementation of Gil Tene's HDR Histogram.
MIT License
435 stars 64 forks source link

Fix rounding to be consistent with upstream #7

Closed zenazn closed 9 years ago

zenazn commented 9 years ago

The upstream (Java) implementation casts to long in a few places, which truncates floating point numbers. This logic was missing from this port.

I think this is the code this is taken from: https://github.com/HdrHistogram/HdrHistogram/blob/aa16b7145c5f519bd2550048ba270c86c300b7f8/src/main/java/org/HdrHistogram/PercentileIterator.java#L65-L68

I don't know what, if anything, this affects (the tests pass either way, and I'm not familiar enough with the code to try to write a failing test case of my own).