get Max Element in double array - Java XML

Java examples for XML:DOM Element

Description

get Max Element in double array

Demo Code


//package com.java2s;

public class Main {
    public static double getMaxElement(double[] data) {
        double tmp = 0.0;
        for (int i = 0; i < data.length; i++)
            tmp = tmp > data[i] ? tmp : data[i];
        return tmp;
    }/*from   w w w  .  j a v  a  2s.co m*/
}

Related Tutorials