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