Here you can find the source of min(double... a)
Parameter | Description |
---|---|
The | vararg of doubles. |
public static double min(double... a)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010-2015 BSI Business Systems Integration AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from www .j a v a 2 s .co m*/ * BSI Business Systems Integration AG - initial API and implementation ******************************************************************************/ public class Main { /** * Computes the minimum value of a vararg of doubles. * * @param The * vararg of doubles. * @return The minimum. Returns 0 if the parameter is null or the length of the vararg is 0. */ public static double min(double... a) { if (a == null) { return 0; } if (a.length == 0) { return 0; } double min = Double.MAX_VALUE; for (double d : a) { min = Math.min(min, d); } return min; } }