Java Number Min Value min(Double first, Double second)

Here you can find the source of min(Double first, Double second)

Description

min

License

Open Source License

Parameter

Parameter Description
first first double.
second second double.

Return

the minimum of the two doubles. A null double is considered to be 0.

Declaration

public static Double min(Double first, Double second) 

Method Source Code

//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);
    }
}

Related

  1. min(Double a, Double b)
  2. min(double a, double b)
  3. min(double a, double b, boolean backward)
  4. min(double a, double b, double c, double d)
  5. min(double d1, double d2)
  6. min(double one, double two)
  7. min(double v1, double v2, double v3, double v4)
  8. min(double x, double y)
  9. min(final float a, final float b)