Java Number Min Value min(final float a, final float b, final float c)

Here you can find the source of min(final float a, final float b, final float c)

Description

Returns the minimum value of three floats.

License

Open Source License

Parameter

Parameter Description
a a parameter
b a parameter
c a parameter

Return

min val

Declaration

public static final float min(final float a, final float b, final float c) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2012 Andreas H?hmann/*  w  w  w  .  j a  v a 2 s  . co  m*/
 *
 * All rights reserved. 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 {
    public static final double min(final double a, final double b) {
        return a < b ? a : b;
    }

    public static final double min(final double a, final double b, final double c) {
        return a < b ? a < c ? a : c : b < c ? b : c;
    }

    public static final float min(final float a, final float b) {
        return a < b ? a : b;
    }

    /**
     * Returns the minimum value of three floats.
     * 
     * @param a
     * @param b
     * @param c
     * @return min val
     */
    public static final float min(final float a, final float b, final float c) {
        return a < b ? a < c ? a : c : b < c ? b : c;
    }

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

    /**
     * Returns the minimum value of three ints.
     * 
     * @param a
     * @param b
     * @param c
     * @return min val
     */
    public static final int min(final int a, final int b, final int c) {
        return a < b ? a < c ? a : c : b < c ? b : c;
    }
}

Related

  1. min(double one, double two)
  2. min(double v1, double v2, double v3, double v4)
  3. min(double x, double y)
  4. min(final float a, final float b)
  5. min(final float a, final float b)
  6. min(final int a, final int b)
  7. min(final int a, final int b)
  8. min(final Iterable numbers)
  9. min(final NUMBER_TYPE n1, final NUMBER_TYPE n2)