code: private double computeQuantile(double ration, int totalCount) throws IllegalStateException, IllegalArgumentException {
  		if (ration <= 0.0D || ration >= 1.0D) {
  			throw new IllegalArgumentException("Expected ratio between 0 and 1 excluded: " + ration);
  		}
  		final double expectedCount = ration * totalCount;
  		// Search bucket corresponding to expected count
  		double lastCount = 0D, newCount;
  		int bucketIndex = 0;
  		for (int i = 0; i < buckets.length; i++) {
  			newCount = lastCount + buckets[i].getCount();
  			if (expectedCount >= lastCount && expectedCount < newCount) {
  				bucketIndex = i;
  				break;
  			}
  			lastCount = newCount;
  		}
  		// Check that bucket index is in bounds
  		if (bucketIndex == 0) {
  			throw new IllegalStateException("Quantile out of bounds: decrease min");
  		} else if (bucketIndex == bucketNb + 1) {
  			throw new IllegalStateException("Quantile out of bounds: increase max");
  		}
  		// Interpolation of value
  		final Bucket bucket = buckets[bucketIndex];
  		return estimateQuantile(bucket, expectedCount, lastCount);
  	}
docs: Computes given quantile.
  
  @param ration Nth quantile: 0.5 is median
  @param totalCount Total count over all buckets
  @return Quantile
  @throws IllegalStateException Buckets are poorly configured and
  quantile can not be computed
  @throws IllegalArgumentException