code: public int num2index(double value, double[] cuts) {
      int count = 0;
      while ((count < cuts.length) && (cuts[count] <= value)) {
        count++;
      }
      return count;
    }
docs: Get mapping of number to cut index.
  
  @param value the value to map.
  @param cuts the array of intervals.
  @return character corresponding to numeric value.