Here you can find the source of min(double[] a)
Parameter | Description |
---|---|
a | an array of doubles |
public static double min(double[] a)
//package com.java2s; public class Main { /** /* w w w. ja va2 s . c o m*/ * Returns the min element in a double array * @param a an array of doubles * @return the min element in this double array */ public static double min(double[] a) { double min = a[0]; // assume fst element is the min //compare against remaining elements for (int i = 1; i < a.length; i++) { if (a[i] < min) { min = a[i]; // new min } } return min; } }