code: public long getValueAtPercentile(final double percentile) {
          final double requestedPercentile = Math.min(percentile, 100.0); // Truncate down to 100%
          long countAtPercentile = (long)(((requestedPercentile / 100.0) * getTotalCount()) + 0.5); // round to nearest
          countAtPercentile = Math.max(countAtPercentile, 1); // Make sure we at least reach the first recorded entry
          long totalToCurrentIndex = 0;
          for (int i = 0; i < countsArrayLength; i++) {
              totalToCurrentIndex += getCountAtIndex(i);
              if (totalToCurrentIndex >= countAtPercentile) {
                  long valueAtIndex = valueFromIndex(i);
                  return (percentile == 0.0) ?
                          lowestEquivalentValue(valueAtIndex) :
                          highestEquivalentValue(valueAtIndex);
              }
          }
          return 0;
      }
docs: Get the value at a given percentile.
  When the given percentile is &gt; 0.0, the value returned is the value that the given
  percentage of the overall recorded value entries in the histogram are either smaller than
  or equivalent to. When the given percentile is 0.0, the value returned is the value that all value
  entries in the histogram are either larger than or equivalent to.
  <p>
  Note that two values are "equivalent" in this statement if
  {@link org.HdrHistogram_voltpatches.AbstractHistogram#valuesAreEquivalent} would return true.
  
  @param percentile  The percentile for which to return the associated value
  @return The value that the given percentage of the overall recorded value entries in the
  histogram are either smaller than or equivalent to. When the percentile is 0.0, returns the
  value that all value entries in the histogram are either larger than or equivalent to.