Java Number Min Value min(int a, int b)

Here you can find the source of min(int a, int b)

Description

min

License

Apache License

Declaration

public static int min(int a, int b) 

Method Source Code

//package com.java2s;
/*//from   ww  w . j a v a2 s.  co  m
 * Copyright (c) 2014. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * http://www.apache.org/licenses/LICENSE-2.0
 */

public class Main {
    private static long negativeZeroDoubleBits = Double.doubleToLongBits(-0.0d);

    public static int min(int a, int b) {
        return (a <= b) ? a : b;
    }

    public static double min(double a, double b) {
        if (a != a)
            return a; // a is NaN
        if ((a == 0.0d) && (b == 0.0d) && (Double.doubleToLongBits(b) == negativeZeroDoubleBits)) {
            return b;
        }
        return (a <= b) ? a : b;
    }
}

Related

  1. min(float x0, float x1)
  2. min(int a, int b)
  3. min(int a, int b)
  4. min(int a, int b)
  5. min(int a, int b)
  6. min(int a, int b)
  7. min(int a, int b)
  8. min(int a, int b)
  9. min(int a, int b)