Here you can find the source of max(long[] array)
Parameter | Description |
---|---|
array | a long array. |
public static double max(long[] array)
//package com.java2s; // it under the terms of the GNU General Public License as published by // public class Main { /**// w w w .j a va 2s .c o m * @param array a long array. * @return the maximum of the values in this array. */ public static double max(long[] array) { return max(array, array.length); } /** * @param array a double array. * @return the maximum of the values in this array. */ public static double max(double[] array) { return max(array, array.length); } /** * @param array a long array. * @param N the number of values of array which should be considered. * @return the maximum of the first N values in this array. */ public static double max(long array[], int N) { double max = array[0]; for (int i = 0; i < N; i++) { if (array[i] > max) { max = array[i]; } } return max; } /** * @param array a double array. * @param N the number of values of array which should be considered. * @return the maximum of the first N values in this array. */ public static double max(double array[], int N) { double max = array[0]; for (int i = 0; i < N; i++) { if (array[i] > max) { max = array[i]; } } return max; } }