code: public double rankLatency(float rank)
      {
          if (sample.length == 0)
              return 0;
          int index = (int)(rank * sample.length);
          if (index >= sample.length)
              index = sample.length - 1;
          return sample[index] * 0.000001d;
      }
docs: 0 < rank < 1