Java Array Max Value max(double[] a)

Here you can find the source of max(double[] a)

Description

max

License

Open Source License

Declaration

public static double max(double[] a) 

Method Source Code

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

public class Main {
    public static double max(double[] a) {
        return a[maxInd(a)];
    }//from  w  w w  . j  a v a  2  s .  com

    public static int maxInd(double[] a) {
        double max = Double.NEGATIVE_INFINITY;
        int maxInd = -1;
        for (int i = 0; i < a.length; i++) {

            if (a[i] > max) {
                maxInd = i;
                max = a[i];
            }
        }

        return maxInd;
    }
}

Related

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