get Min Element in double array - Java XML

Java examples for XML:DOM Element

Description

get Min Element in double array

Demo Code


//package com.java2s;

public class Main {
    public static double getMinElement(double[] data) {
        double tmp = data[0];
        for (int i = 0; i < data.length; i++)
            tmp = tmp < data[i] ? tmp : data[i];
        return tmp;
    }//from w  w w  .  j av a  2 s .  c  o  m
}

Related Tutorials