Java Number Max Value max(double one, double two)

Here you can find the source of max(double one, double two)

Description

max

License

Apache License

Parameter

Parameter Description
one a parameter
two a parameter

Declaration

public static double max(double one, double two) 

Method Source Code

//package com.java2s;
/**/*from  ww  w  . j  ava 2 s .  c o m*/
 * MathUtils.java
 * 
 * Copyright 2011 FooBrew, Inc.
 *
 * 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 {
    /**
     * 
     * @param one
     * @param two
     * @return
     */
    public static double max(double one, double two) {
        return Math.max(one, two);
    }

    /**
     * 
     * @param doubles
     * @return
     */
    public static double max(double... doubles) {
        double max = -1d;

        for (double d : doubles) {
            if (max == -1d || d > max) {
                max = d;
            }
        }

        return max;
    }
}

Related

  1. max(double first, double second, double third, double fourth)
  2. max(double n1, double n2, double n3)
  3. max(double no1, double no2, double no3)
  4. max(double num1, double num2, double num3)
  5. max(double number1, double number2)
  6. max(double paramDouble1, double paramDouble2, double paramDouble3)
  7. max(double v1, double v2, double v3, double v4)
  8. max(double x, double y)
  9. max(double x0, double x1, double x2)