Java Array Max Value max(double... arr)

Here you can find the source of max(double... arr)

Description

max

License

Open Source License

Declaration

public static double max(double... arr) 

Method Source Code

//package com.java2s;
/**// w w  w .  j ava2 s.c o m
 * Copyright (c) Lambda Innovation, 2013-2015
 * ?????????Lambda Innovation???
 * http://www.li-dev.cn/
 *
 * This project is open-source, and it is distributed under 
 * the terms of GNU General Public License. You can modify
 * and distribute freely as long as you follow the license.
 * ?????????????????GNU?????????????
 * ????????????????????????????
 * http://www.gnu.org/licenses/gpl.html
 */

public class Main {
    public static int max(int... arr) {
        int max = Integer.MIN_VALUE;
        for (int i : arr)
            if (i > max)
                max = i;
        return max;
    }

    public static double max(double... arr) {
        double max = Double.MIN_VALUE;
        for (double d : arr)
            if (d > max)
                max = d;
        return max;
    }
}

Related

  1. max(D... comparables)
  2. max(double array[], int start, int length)
  3. max(double values[])
  4. max(double values[], int size)
  5. max(double... a)
  6. max(double... ds)
  7. max(double... ds)
  8. max(double... elems)
  9. max(double... nums)