Java Array Min Value min(double[] array)

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

Description

min

License

Open Source License

Declaration

public final static double min(double[] array) 

Method Source Code

//package com.java2s;

public class Main {
    public final static double min(double[] array) {
        if (array.length == 0)
            return 0;
        double res = array[0];
        for (int i = 1; i < array.length; i++) {
            res = Math.min(res, array[i]);
        }/*from  w  ww .  jav  a  2 s . co  m*/
        return res;
    }

    public final static int min(int[] array) {
        if (array.length == 0)
            return 0;
        int res = array[0];
        for (int i = 1; i < array.length; i++) {
            res = Math.min(res, array[i]);
        }
        return res;
    }

    public final static double min(double[][] array, int col) {
        if (array.length == 0)
            return 0;
        double res = array[0][col];
        for (int i = 1; i < array.length; i++) {
            res = Math.min(res, array[i][col]);
        }
        return res;
    }

    public final static double min(float[][] array, int col) {
        if (array.length == 0)
            return 0;
        float res = array[0][col];
        for (int i = 1; i < array.length; i++) {
            res = Math.min(res, array[i][col]);
        }
        return res;
    }
}

Related

  1. min(double[] array)
  2. min(double[] array)
  3. min(double[] array)
  4. min(double[] array)
  5. min(double[] array)
  6. min(double[] array)
  7. min(double[] da)
  8. min(double[] data)
  9. min(double[] matrix)