Here you can find the source of min(Double first, Double second)
Parameter | Description |
---|---|
first | first double. |
second | second double. |
null
double is considered to be 0.
public static Double min(Double first, Double second)
//package com.java2s; //License from project: Open Source License public class Main { /**// ww w .j a v a 2s.c o m * @param first first double. * @param second second double. * @return the minimum of the two doubles. A <code>null</code> double is considered to be 0. */ public static Double min(Double first, Double second) { Double firstNotNull = first; Double secondNotNull = second; if (firstNotNull == null) { firstNotNull = 0d; } if (secondNotNull == null) { secondNotNull = 0d; } return Math.min(firstNotNull, secondNotNull); } }