Java Array Min Value min(int... arr)

Here you can find the source of min(int... arr)

Description

min

License

Open Source License

Declaration

public static int min(int... arr) 

Method Source Code

//package com.java2s;
/**/*  w ww . java2 s.com*/
 * Copyright (c) Lambda Innovation, 2013-2015
 * ?????????Lambda Innovation???
 * http://www.li-dev.cn/
 *
 * This project is open-source, and it is distributed under 
 * the terms of GNU General Public License. You can modify
 * and distribute freely as long as you follow the license.
 * ?????????????????GNU?????????????
 * ????????????????????????????
 * http://www.gnu.org/licenses/gpl.html
 */

public class Main {
    public static int min(int... arr) {
        int min = Integer.MAX_VALUE;
        for (int i : arr)
            if (i < min)
                min = i;
        return min;
    }

    public static double min(double... arr) {
        double min = Double.MAX_VALUE;
        for (double d : arr)
            if (d < min)
                min = d;
        return min;
    }
}

Related

  1. min(float[][] a)
  2. min(float[][] originalValues, float[][] newValues, int[] indexArray, float value)
  3. min(int receiver, int... others)
  4. min(int value1, int value2, int... values)
  5. min(int... _is)
  6. min(int... array)
  7. min(int... array)
  8. min(int... list)
  9. min(int... numbers)