Java Array Min Value min(double values[], int size)

Here you can find the source of min(double values[], int size)

Description

min

License

Apache License

Declaration

public final static double min(double values[], int size) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public final static double min(double values[], int size) {
        if (values == null || size == 0) {
            return Double.NaN;
        }/*from w  w w . j  av  a2 s.c  o m*/

        double r = Double.POSITIVE_INFINITY;
        for (int i = 0; i < size; i++) {
            double v = values[i];
            if (!Double.isNaN(v) && r > v) {
                r = v;
            }
        }
        return r == Double.POSITIVE_INFINITY ? Double.NaN : r;
    }
}

Related

  1. maxValue(long[] array)
  2. min(byte[] arr)
  3. min(byte[] array)
  4. min(byte[] values)
  5. min(double values[], boolean[] mask)
  6. min(double... a)
  7. min(double... args)
  8. min(double... d)
  9. min(double... ds)