code: public static double min(double a, double b) {
          if (a != a)
              return a;   // a is NaN
          if ((a == 0.0d) &&
              (b == 0.0d) &&
              (Double.doubleToRawLongBits(b) == negativeZeroDoubleBits)) {
              // Raw conversion ok since NaN can't map to -0.0.
              return b;
          }
          return (a <= b) ? a : b;
      }
docs: Returns the smaller of two {@code double} values.  That
  is, the result is the value closer to negative infinity. If the
  arguments have the same value, the result is that same
  value. If either value is NaN, then the result is NaN.  Unlike
  the numerical comparison operators, this method considers
  negative zero to be strictly smaller than positive zero. If one
  argument is positive zero and the other is negative zero, the
  result is negative zero.
  
  @param   a   an argument.
  @param   b   another argument.
  @return  the smaller of {@code a} and {@code b}.