Java Array Max Value max(float[] in, int[] idx)

Here you can find the source of max(float[] in, int[] idx)

Description

max

License

Apache License

Declaration

public static final float max(float[] in, int[] idx) 

Method Source Code

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

public class Main {
    public static final float max(float[] in, int[] idx) {
        float max = in[0];
        for (int i = 1; i < in.length; i++) {
            if (in[i] > max) {
                max = in[i];// w  w w .  j a  v a  2s .  co m
            }
        }
        return max;
    }

    public static final int max(int[] in) {
        int out = in[0];
        for (int i = 1; i < in.length; i++) {
            if (in[i] > out) {
                out = in[i];
            }
        }
        return out;
    }

    public static final double max(double[] in) {
        double out = in[0];
        for (int i = 1; i < in.length; i++) {
            if (in[i] > out) {
                out = in[i];
            }
        }
        return out;
    }

    public static final float max(float[] in) {
        float out = in[0];
        for (int i = 1; i < in.length; i++) {
            if (in[i] > out) {
                out = in[i];
            }
        }
        return out;
    }
}

Related

  1. max(float... a)
  2. max(float... fs)
  3. max(float... fs)
  4. max(float... values)
  5. max(float[] floats)
  6. max(float[] position, int x)
  7. max(float[] t)
  8. max(float[] v1, float[] v2)
  9. max(int array[])