Here you can find the source of min(final float a, final float b, final float c)
Parameter | Description |
---|---|
a | a parameter |
b | a parameter |
c | a parameter |
public static final float min(final float a, final float b, final float c)
//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; } }