Here you can find the source of max(int a, int b)
public static int max(int a, int b)
//package com.java2s; /*//from w w w .java 2 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 max(int a, int b) { return (a >= b) ? a : b; } public static double max(double a, double b) { if (a != a) return a; // a is NaN if ((a == 0.0d) && (b == 0.0d) && (Double.doubleToLongBits(a) == negativeZeroDoubleBits)) { return b; } return (a >= b) ? a : b; } }