Java Array Max Value max(float[] t)

Here you can find the source of max(float[] t)

Description

max

License

LGPL

Declaration

public static float max(float[] t) 

Method Source Code

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

public class Main {
    public static float max(float[] t) {
        float maximum = 0;
        if (t.length != 0) {
            maximum = t[0]; // start with the first value
            for (int i = 1; i < t.length; i++) {
                if (t[i] > maximum) {
                    maximum = t[i]; // new maximum
                }/*from  w w  w  .j  a va  2 s .c o  m*/
            }
        }
        return maximum;
    }
}

Related

  1. max(float... fs)
  2. max(float... values)
  3. max(float[] floats)
  4. max(float[] in, int[] idx)
  5. max(float[] position, int x)
  6. max(float[] v1, float[] v2)
  7. max(int array[])
  8. max(int value1, int value2, int... values)
  9. max(int... _is)