Java Array Max Value max(final double[] values)

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

Description

max

License

Apache License

Declaration

public static double max(final double[] values) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static double max(final double[] values) {
        int maxid = argMax(values);
        return values[maxid];
    }/*from  w  ww.j a va2 s .c o  m*/

    public static int argMax(final double[] values) {
        int maxid = 0;
        double maxvalue = -Double.MAX_VALUE;
        for (int i = 0; i < values.length; i++) {
            if (values[i] > maxvalue) {
                maxvalue = values[i];
                maxid = i;
            }
        }
        return maxid;
    }
}

Related

  1. max(final double[] array)
  2. Max(final double[] input)
  3. max(final double[] nums)
  4. max(final double[] tab)
  5. max(final double[] target)
  6. max(final double[] vec)
  7. max(final float[] a, final float[] b)
  8. max(final int... array)
  9. max(final int... integers)