Here you can find the source of min(double[] values)
Parameter | Description |
---|---|
values | double array the minimum is calculated from |
public static double min(double[] values)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w . j a v a 2 s . co m * Calculates the minimum over an given array of doubles. * * @param values * double array the minimum is calculated from * @return minimum value of the given double array */ public static double min(double[] values) { double min = values[0]; for (double v : values) { if (v < min) min = v; } return min; } /** * Calculates the minimum over an given array of integers. * * @param values * integer array the minimum is calculated from * @return minimum value of the given integer array */ public static int min(int[] values) { int min = values[0]; for (int v : values) { if (v < min) min = v; } return min; } /** * Calculates the minimum over an given array of longs. * * @param values * long array the minimum is calculated from * @return minimum value of the given long array */ public static long min(long[] values) { long min = values[0]; for (long v : values) { if (v < min) min = v; } return min; } }