public static double min(double[] a,int lo,int hi){
  if (lo < 0 || hi >= a.length || lo > hi)   throw new IndexOutOfBoundsException("Subarray indices out of bounds");
  double min=Double.POSITIVE_INFINITY;
  for (int i=lo; i <= hi; i++) {
    if (Double.isNaN(a[i]))     return Double.NaN;
    if (a[i] < min)     min=a[i];
  }
  return min;
}

public static double min ( double [ ] a , int lo , int hi ) { if ( lo < 0 || hi >= a . length || lo > hi ) throw new IndexOutOfBoundsException ( "Subarray indices out of bounds" ) ; double min = Double . POSITIVE_INFINITY ; for ( int i = lo ; i <= hi ; i ++ ) { if ( Double . isNaN ( a [ i ] ) ) return Double . NaN ; if ( a [ i ] < min ) min = a [ i ] ; } return min ; }
returns the minimum value in the specified subarray .
