Java Number Min Value minimum(long a, long b, long c)

Here you can find the source of minimum(long a, long b, long c)

Description

Gets the minimum of three long values.

License

Apache License

Parameter

Parameter Description
a value 1
b value 2
c value 3

Return

the smallest of the values

Declaration

public static long minimum(long a, long b, long c) 

Method Source Code

//package com.java2s;
/*/*from   w  w w  .  j ava2  s.c o m*/
 * Copyright 2002-2005 The Apache Software Foundation.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

public class Main {
    /**
     * <p>Gets the minimum of three <code>long</code> values.</p>
     * 
     * @param a  value 1
     * @param b  value 2
     * @param c  value 3
     * @return  the smallest of the values
     */
    public static long minimum(long a, long b, long c) {
        if (b < a) {
            a = b;
        }
        if (c < a) {
            a = c;
        }
        return a;
    }

    /**
     * <p>Gets the minimum of three <code>int</code> values.</p>
     * 
     * @param a  value 1
     * @param b  value 2
     * @param c  value 3
     * @return  the smallest of the values
     */
    public static int minimum(int a, int b, int c) {
        if (b < a) {
            a = b;
        }
        if (c < a) {
            a = c;
        }
        return a;
    }
}

Related

  1. Minimum(int a, int b, int c)
  2. minimum(int a, int b, int c)
  3. minimum(int a, int b, int c)
  4. minimum(int a, int b, int c)
  5. minimum(Integer one, Integer two)
  6. minimumEditDistance(String target, String source)
  7. minIndent(int a, int b)
  8. minIndex(int a, int b)
  9. minIndex(int ix1, int ix2)