Here you can find the source of min(double[] da)
Parameter | Description |
---|---|
da | - input vector of doubles. |
public static double min(double[] da)
//package com.java2s; public class Main { /**/*from w ww. j a v a 2 s . co m*/ * Returns the minimum value in vector of doubles. * @param da - input vector of doubles. * @return - the minimum value within the vector. */ public static double min(double[] da) { if (da.length == 0) { return Double.NaN; } double out = Double.POSITIVE_INFINITY; for (int i = 0; i < da.length; i++) { out = Math.min(out, da[i]); } return out; } /** * @param da - a vector of double values. * @param val - the comparison value. * @return the minimum value between an array of doubles and a given value. */ public static double min(double[] da, double val) { double out = val; for (int i = 0; i < da.length; i++) { out = Math.min(out, da[i]); } return out; } }