Here you can find the source of minDoubleArray(double[] data)
Parameter | Description |
---|---|
data | the array. |
private static int minDoubleArray(double[] data)
//package com.java2s; //License from project: Apache License public class Main { /**//from w w w. ja v a2s .co m * Get the minimum from a double array. * * @param data * the array. * @return the minimum. */ private static int minDoubleArray(double[] data) { double minimum = data[0]; int minIndex = 0; for (int i = 1; i < data.length; i++) { if (data[i] < minimum) { minimum = data[i]; minIndex = i; } } return minIndex; } }