Gets the lower number - Android java.lang

Android examples for java.lang:Math

Description

Gets the lower number

Demo Code


//package com.java2s;

public class Main {
    /**//ww  w  .  j a  v  a  2s  .c  o m
     * Gets the lower number
     * 
     * @param a
     *            float number
     * @param b
     *            float number
     * @return the lower number between a and b
     */
    public static float min(float a, float b) {
        return a < b ? a : b;
    }

    /**
     * Gets the lower number
     * 
     * @param a
     *            float number
     * @param b
     *            float number
     * @return the lower number between a and b
     */
    public static int min(int a, int b) {
        return a < b ? a : b;
    }
}

Related Tutorials