Here you can find the source of minAndMaxOfArray(float[] array)
Parameter | Description |
---|---|
array | the array |
public static float[] minAndMaxOfArray(float[] array)
//package com.java2s; /*//ww w . ja va2s . co m * Copyright (C) 2010-2014 Andreas Maier * CONRAD is developed as an Open Source project under the GNU General Public License (GPL). */ public class Main { /** * Returns the minimal and the maximal value in a given array * @param array the array * @return an array with minimal and maximal value */ public static float[] minAndMaxOfArray(float[] array) { float[] revan = new float[2]; revan[0] = Float.MAX_VALUE; revan[1] = -Float.MAX_VALUE; for (int i = 0; i < array.length; i++) { if (array[i] < revan[0]) { revan[0] = array[i]; } if (array[i] > revan[1]) { revan[1] = array[i]; } } return revan; } }