Here you can find the source of max(final double[] values)
public static double max(final double[] values)
//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; } }