Java Array Min Value findMin(float[] array)

Here you can find the source of findMin(float[] array)

Description

Finds minimal element in array

License

Open Source License

Parameter

Parameter Description
array array

Return

Minimum Value

Declaration

public static float findMin(float[] array) 

Method Source Code

//package com.java2s;
/*//  w ww .j a  va2 s.  co  m
 * Copyright (c) 2008-2013 Maksim Khadkevich and Fondazione Bruno Kessler.
 *
 * This file is part of MART.
 * MART is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2, as published
 * by the Free Software Foundation.
 *
 * MART is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with MART; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

public class Main {
    /**
     * Finds minimal element in array
     *
     * @param array array
     * @return Minimum Value
     */
    public static float findMin(float[] array) {
        float min = Float.MAX_VALUE;
        for (int i = 0; i < array.length; i++) {
            if (array[i] < min) {
                min = array[i];
            }
        }
        return min;
    }
}

Related

  1. arrayMin(double minVal, double[] vals)
  2. arrayMin(double[] arr)
  3. arrayMin(double[] x)
  4. arrayMin(final double[] array)
  5. arrayMin(int[] property)
  6. findMin(int[] workArray, int idx)
  7. findMin(String[] strs)
  8. findMin2(int[] workArray, int idx, int min)
  9. findMinAndMax(double[] array)