Java Array Max Value max(final float[] a, final float[] b)

Here you can find the source of max(final float[] a, final float[] b)

Description

Writes max(a,b) into a

License

Open Source License

Parameter

Parameter Description
a a parameter
b a parameter

Declaration

final static public void max(final float[] a, final float[] b) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*from ww w.  j  a va  2  s.  c  o  m*/
     * Writes max(a,b) into a
     *
     * @param a
     * @param b
     */
    final static public void max(final float[] a, final float[] b) {
        for (int i = 0; i < a.length; ++i)
            if (b[i] > a[i])
                a[i] = b[i];
    }

    /**
     * Writes max(a,b) into a
     *
     * @param a
     * @param b
     */
    final static public void max(final double[] a, final double[] b) {
        for (int i = 0; i < a.length; ++i)
            if (b[i] > a[i])
                a[i] = b[i];
    }
}

Related

  1. max(final double[] nums)
  2. max(final double[] tab)
  3. max(final double[] target)
  4. max(final double[] values)
  5. max(final double[] vec)
  6. max(final int... array)
  7. max(final int... integers)
  8. max(final int... numbers)
  9. max(final int... values)