Here you can find the source of max(double values[])
Parameter | Description |
---|---|
values | the vector |
public static double max(double values[])
//package com.java2s; //License from project: Open Source License public class Main { /**// ww w. j av a2 s .co m * Finds maximum value in the given vector. * @param values the vector * @return the maximum in the given vector */ public static double max(double values[]) { double max = Double.NEGATIVE_INFINITY; for (double value : values) { if (value > max) max = value; } return max; } /** * Finds maximum value in the given vector. * @param values the vector * @return the maximum in the given vector */ public static int max(int values[]) { int max = Integer.MIN_VALUE; for (int value : values) { if (value > max) max = value; } return max; } }