Java Array Min Value min(final double[] vec)

Here you can find the source of min(final double[] vec)

Description

Computes the minimum of the elements of a vector.

License

Open Source License

Parameter

Parameter Description
vec the vector.

Return

the minimum of the elements of the vector.

Declaration

public static double min(final double[] vec) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/* w w w .j a v  a 2  s . c om*/
    * Computes the minimum of the elements of a vector.
    * @param vec   the vector.
    * @return      the minimum of the elements of the vector.
    */
    public static double min(final double[] vec) {
        assert vec != null;

        double min = vec[0];
        for (double i : vec) {
            if (i < min) {
                min = i;
            }
        }
        return min;
    }
}

Related

  1. min(final Double... values)
  2. Min(final double[] input)
  3. min(final double[] nums)
  4. min(final double[] tab)
  5. min(final double[] target)
  6. min(final double[] vector)
  7. min(final float[] a, final float[] b)
  8. min(final int... array)
  9. min(final int... integers)