Get min value from list of float - Android java.util

Android examples for java.util:List Algorithm

Description

Get min value from list of float

Demo Code


//package com.java2s;

public class Main {
    public static float fmin(final float... values) {
        float min = Float.MAX_VALUE;
        for (final float v : values) {
            min = Math.min(v, min);
        }/*from   w w w.jav a  2s .c o m*/
        return min;
    }

    public static int min(final int... values) {
        int min = Integer.MAX_VALUE;
        for (final int v : values) {
            min = Math.min(v, min);
        }
        return min;
    }
}

Related Tutorials