Java Array Max Value maxElement(double[] d)

Here you can find the source of maxElement(double[] d)

Description

max Element

License

Open Source License

Declaration

public static double maxElement(double[] d) 

Method Source Code

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

public class Main {
    public static double maxElement(double[] d) {
        if (d.length == 0)
            throw new IllegalArgumentException("length cannot be 0.");
        double maxValue = d[0];
        for (int i = 1; i < d.length; i++) {
            if (d[i] > maxValue)
                maxValue = d[i];//from ww w.  j a v  a  2s. c  o  m
        }
        return maxValue;
    }
}

Related

  1. maxdex(float... values)
  2. maxdiffbits(int initoffset, int[] i, int pos, int length)
  3. maxDiffLocation(double[] list1, double[] list2)
  4. maxDistance(byte[] array, int maxDistance)
  5. maxDouble(double a, double... others)
  6. maxElement(int[] array)
  7. maxElementIndex(final double[] array)
  8. maxElementIndex(final double[] array)
  9. maxElementIndex(final double[] array, final int endIndex)