Here you can find the source of findMin(double newNumber, double currentMin)
Parameter | Description |
---|
public static double findMin(double newNumber, double currentMin)
//package com.java2s; //License from project: Open Source License public class Main { /**/* w w w. ja v a 2s . c om*/ * Return the min between 2 numbers. If the * current min is initialized as NaN, it automatically * sets as min the new number. * @param newNumber, the number we are going to compare against the existing * min. * @param currentMin, the existing min, can be initialized as Double.NaN * if it doesn't exist yet. * @return the min between the 2 numbers. */ public static double findMin(double newNumber, double currentMin) { return Double.isNaN(currentMin) ? newNumber : currentMin > newNumber ? currentMin : newNumber; } }