Java Array Max Value arrayMax(double[] x)

Here you can find the source of arrayMax(double[] x)

Description

array Max

License

Open Source License

Declaration

public static double arrayMax(double[] x) 

Method Source Code

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

public class Main {
    public static double arrayMax(double[] x) {
        if (x.length == 0) {
            throw new IllegalArgumentException();
        }//from  www.  j a  v a2 s.  c  o m

        double result = x[0];

        for (int i = 1; i < x.length; i++) {
            if (result < x[i]) {
                result = x[i];
            }
        }

        return result;
    }
}

Related

  1. argmax(int[] array)
  2. argmax(int[] array)
  3. argmax(int[] input)
  4. arrayMax(double maxVal, double[] vals)
  5. arrayMax(double[] arr)
  6. arrayMax(final int[] array)
  7. arrayMax(int[] property)
  8. arrayMaximum(int[] array)
  9. findMax(double newNumber, double currentMax)