code: public static double percentile(long[] counts, double p) {
      double[] pcts = new double[] {p};
      double[] results = new double[1];
      percentiles(counts, pcts, results);
      return results[0];
    }
docs: Compute a percentile based on the counts for the buckets.
  
  @param counts
  Counts for each of the buckets. The size must be the same as {@link #length()} and the
  positions must correspond to the positions of the bucket values.
  @param p
  Percentile to compute, the value should be {@code 0.0 <= p <= 100.0}.
  @return
  The calculated percentile value.