Here you can find the source of maxPosition(float[] v)
public static int maxPosition(float[] v)
//package com.java2s; //License from project: Apache License public class Main { public static int maxPosition(float[] v) { int pos = 0; Float max = Float.MIN_VALUE; for (int i = 0; i < v.length; ++i) { if (v[i] > max) { pos = i;/*from w w w.j a v a 2 s .c o m*/ max = v[i]; } } return pos; } }