Java Array Max Value max(double[] array)

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

Description

max

License

Open Source License

Declaration

public static double max(double[] array) 

Method Source Code

//package com.java2s;

public class Main {
    public static double max(double[] array) {

        double max = Double.NEGATIVE_INFINITY;
        for (int i = 0; i < array.length; i++) {
            if (array[i] > max) {
                max = array[i];/* w ww  . j  a v a  2 s . co  m*/
            }
        }
        return max;
    }

    public static float max(float[] array) {

        float max = Float.NEGATIVE_INFINITY;
        for (int i = 0; i < array.length; i++) {
            if (array[i] > max) {
                max = array[i];
            }
        }
        return max;
    }
}

Related

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