Java Array Max Value Max(final double[] input)

Here you can find the source of Max(final double[] input)

Description

Max

License

Open Source License

Declaration

public static double Max(final double[] input) 

Method Source Code

//package com.java2s;
/*//from w ww  .  ja v  a2 s .co  m
 * This is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute
 * it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by
 * Sam Hocevar. See http://www.wtfpl.net/ for more details.
 */

public class Main {
    public static double Max(final double[] input) {
        if (input == null || input.length < 1) {
            return 0;
        }

        double output = input[0];
        for (int i = 1; i < input.length; i++) {
            if (input[i] > output) {
                output = input[i];
            }
        }

        return output;
    }
}

Related

  1. max(double[] values)
  2. max(double[] x)
  3. max(final double aval, double[] b, final int bi, final int len)
  4. max(final double... doubles)
  5. max(final double[] array)
  6. max(final double[] nums)
  7. max(final double[] tab)
  8. max(final double[] target)
  9. max(final double[] values)