Here you can find the source of max(double values[], int size)
public final static double max(double values[], int size)
//package com.java2s; //License from project: Apache License public class Main { public final static double max(double values[], int size) { if (values == null || size == 0) { return Double.NaN; }// w w w . jav a2 s. c o m double r = Double.NEGATIVE_INFINITY; for (int i = 0; i < size; i++) { double v = values[i]; if (!Double.isNaN(v) && r < v) { r = v; } } return r == Double.NEGATIVE_INFINITY ? Double.NaN : r; } }