Here you can find the source of min(int a, int b)
public final static int min(int a, int b)
//package com.java2s; //License from project: Apache License public class Main { /** @return The minimum of a and b.*/ public final static int min(int a, int b) { return a < b ? a : b; }/*from w ww. j a v a 2 s . c o m*/ /** @return The minimum of a, b and c.*/ public final static int min(int a, int b, int c) { return min(a, min(b, c)); } /** @return The minimum of the array a. */ public final static int min(int[] a) { int result = Integer.MAX_VALUE; for (int i = 0; i < a.length; i++) if (a[i] < result) result = a[i]; return result; } /** @return The minimum of the array a. */ public final static double min(double[] a) { double result = Double.MAX_VALUE; for (int i = 0; i < a.length; i++) if (a[i] < result) result = a[i]; return result; } }