Returns the minimum value in the given array, or
<code>Double.POSITIVE_INFINITY</code> if the given array
has a size of 0.

@param array The array
@return The minimum value
188293
public static double min(DoubleArrayND array)
    {
        return array.stream().parallel().reduce(
            Double.POSITIVE_INFINITY, Math::min);
    }
190489
function min(array, byProperty) {
    if (!array || array.length === 0) return undefined;
    
    var i = array.length - 1, 
        result = byProperty ? array[i][byProperty] : array[i];

    if (byProperty) {
      while (i--) {
        if (array[i][byProperty] < result) {
          result = array[i][byProperty];
        }
      }
    }
    else {
      while (i--) {
        if (array[i] < result) {
          result = array[i];
        }
      }
    }
    return result;
  }
1290781
public static <E extends Comparable<E>> E searchMin(E[] array) {
        if(array.length == 0) {
            throw new IllegalArgumentException("The array you provided does not have any elements");
        }
        
        E min = array[0];
        
        for(int i = 1; i < array.length; i++) {
            if(array[i].compareTo(min) < 0) {
                min = array[i];
            }
        }
        
        return min;
    }
233528
private int getMax(double data[]) {
        int idx = 0;
        double max = data[0];
        for (int i = 1; i < data.length; i++) {
            if (max < data[i]) {
                max = data[i];
                idx = i;
            }
        }
        return idx;
    }
965480
public static <E extends Comparable<E>> E searchMax(E[] array) {
        if(array.length == 0) {
            throw new IllegalArgumentException("The array you provided does not have any elements");
        }
        E max = array[0];
        for(int i = 1; i < array.length; i++) {
            if(array[i].compareTo(max) > 0 ) {
                max = array[i];
            }
        }
        return max;
    }
343663
public static int indexOf(double[] array, double val) {
        for (int i=0; i<array.length; i++) {
            if (array[i] == val) {
                return i;
            }
        }
        return -1;
    }
391447
public double min(double... values) {
        double min = Double.MAX_VALUE;
        for (int i = 0; i < values.length; i++) {
            if (i == 0 || values[i] < min) {
                min = values[i];
            }
        }
        
        return min;
    }
1099677
public static double avg(Array array) throws ExpressionException {
	if (array.size() == 0) return 0;
	return sum(array) / array.size();
    }
102456
function min(array) {
  var length = array.length;

  if (length === 0) {
    return 0;
  }

  var index = -1;
  var result = array[++index];

  while (++index < length) {
    if (array[index] < result) {
      result = array[index];
    }
  }

  return result;
}
793430
@SafeVarargs
    public static byte min(final byte... a) {
        N.checkArgNotNullOrEmpty(a, "The spcified array 'a' can not be null or empty");

        return min(a, 0, a.length);
    }
609220
public static function GetMaxDepth( array $array ) : int
   {

      if ( \count( $array ) < 1 )
      {
         return 0;
      }

      $c = 1;
      foreach ( $array as $v )
      {

         if ( \is_array( $v ) )
         {
            $x = 1 + static::GetMaxDepth( $v );
            if ( $x > $c )
            {
               $c = $x;
            }
         }

      }

      return $c;

   }
76876
public static <T> T getFirst(T array[]){
        return array!=null && array.length>0 ? array[0] : null;
    }
1078142
public static double min(double[][] matrix) {
        double m = Double.POSITIVE_INFINITY;

        for (double[] x : matrix) {
            for (double y : x) {
                if (m > y) {
                    m = y;
                }
            }
        }

        return m;
    }
928344
static public int asIntValue(byte[] array) {

        if (null == array) {
            return -1;
        }

        int intVal = 0;
        int mark = 1;
        int digit;
        int i = array.length - 1;
        for (; 0 <= i; i--) {
            digit = array[i] - HEX_BYTES[0];
            if (0 > digit || 9 < digit) {
                // stop on any nondigit, if it's not a DASH then throw an exc
                if ('-' != array[i]) {
                    throw new NumberFormatException("Invalid digit: " + array[i]);
                }
                break;
            }
            intVal += digit * mark;
            mark *= 10;
        }

        // check for negative numbers
        if (0 <= i && array[i] == '-') {
            intVal = -intVal;
        }

        return intVal;
    }
792945
public static BigRational min(BigRational... values) {
		if (values.length == 0) {
			return BigRational.ZERO;
		}
		BigRational result = values[0];
		for (int i = 1; i < values.length; i++) {
			result = result.min(values[i]);
		}
		return result;
	}
944843
public static int indexOf(short[] array, short value) {
		if (null != array) {
			for (int i = 0; i < array.length; i++) {
				if (value == array[i]) {
					return i;
				}
			}
		}
		return INDEX_NOT_FOUND;
	}
1137926
public static int[][] toInt(double[][] array) {
        int[][] n = new int[array.length][array[0].length];
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[0].length; j++) {
                n[i][j] = (int) array[i][j];
            }
        }
        return n;
    }