Java List Min getMin(List d)

Here you can find the source of getMin(List d)

Description

Returns the maximum value of an Arraylist with doubles

License

Open Source License

Parameter

Parameter Description
d list

Return

minima

Declaration

public static double getMin(List<Double> d) 

Method Source Code

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

import java.util.List;

public class Main {
    /**/*from w  ww . j av a 2s  .c  o  m*/
     * Returns the maximum value of an Arraylist with doubles
     * 
     * @param d
     *            list
     * @return minima
     */
    public static double getMin(List<Double> d) {
        double res = Double.MAX_VALUE;
        for (Double db : d) {
            if (db < res)
                res = db;
        }
        return res;
    }

    /**
     * Returns the maximum value of an Arraylist with doubles
     * 
     * @param d
     *            array
     * @return minima
     */
    public static double getMin(double[] d) {
        double res = Double.MAX_VALUE;
        for (Double db : d) {
            if (db < res)
                res = db;
        }
        return res;
    }
}

Related

  1. findMin(List nums)
  2. findMin(List values)
  3. getMin(List numList)
  4. getMin(List aList)
  5. getMin(List numbers)
  6. getMinId(List ids)
  7. getMinimums(List data)
  8. getMinValue(List values)