cdm/src/main/java/ucar/ma2/Range.java
public int getFirstInInterval(int start) {
    if (start > last()) return -1;
    if (start <= first) return first;
    if (stride == 1) return start;
    int offset = start - first;
    int i = offset / stride;
    i = (offset % stride == 0) ? i : i + 1; // round up
    return first + i * stride;
  }
public int getFirstInInterval(int start) {
    if (start > last()) return -1;
    if (start <= first) return first;
    if (stride == 1) return start;
    int offset = start - first;
    int i = offset / stride;
    i = (offset % stride == 0) ? i : i + 1; // round up
    return first + i * stride;
  }
public int getFirstInInterval ( int start ) { if ( start > last ( ) ) return - 1 ; if ( start <= first ) return first ; if ( stride == 1 ) return start ; int offset = start - first ; int i = offset / stride ; i = ( offset % stride == 0 ) ? i : i + 1 ; // round up return first + i * stride ; }
Find the first element in a strided array after some index start.
Return the smallest element k in the Range, such that <ul>
<li>k >= first
<li>k >= start
<li>k <= last
<li>k = element of this Range
</ul>

@param start starting index
@return first in interval, else -1 if there is no such element.
Find the first element in a strided array after some index start . Return the smallest element k in the Range such that <ul > <li > k > = first <li > k > = start <li > k < = last <li > k = element of this Range < / ul >