Java Array Max Value max(double... values)

Here you can find the source of max(double... values)

Description

Returns the maximum of a list of doubles

License

Open Source License

Parameter

Parameter Description
values a parameter

Declaration

public static double max(double... values) 

Method Source Code

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

public class Main {
    /** Returns the maximum of a list of doubles
     */*  ww  w .  ja va 2s  . co  m*/
     * @param values
     * @return
     */
    public static double max(double... values) {
        double max = Double.NEGATIVE_INFINITY;

        if (values != null) {
            for (int i = 0; i < values.length; i++) {
                if (values[i] > max) {
                    max = values[i];
                }
            }
        }

        return max;
    }
}

Related

  1. max(double... ds)
  2. max(double... ds)
  3. max(double... elems)
  4. max(double... nums)
  5. max(double... values)
  6. max(double... values)
  7. max(double[] a)
  8. max(double[] arr)
  9. max(double[] array)