Java Array Divide divide(float[] array, float divident)

Here you can find the source of divide(float[] array, float divident)

Description

Divides all entries of array by divident.

License

Open Source License

Parameter

Parameter Description
array the array
divident the number used for division.

Declaration

public static float[] divide(float[] array, float divident) 

Method Source Code

//package com.java2s;
/*//from   w w  w . j  ava2 s  . com
 * Copyright (C) 2010-2014  Andreas Maier
 * CONRAD is developed as an Open Source project under the GNU General Public License (GPL).
*/

public class Main {
    /**
     * Divides all entries of array by divident.
     * @param array the array
     * @param divident the number used for division.
     */
    public static float[] divide(float[] array, float divident) {
        for (int i = 0; i < array.length; i++) {
            array[i] /= divident;
        }
        return array;
    }

    /**
     * Divides all entries of the two arrays element by element.<bR>
     * Works in place and overwrites array.
     * @param array the array
     * @param divident the other array.
     */
    public static float[] divide(float[] array, float[] divident) {
        for (int i = 0; i < array.length; i++) {
            array[i] /= divident[i];
        }
        return array;
    }
}

Related

  1. divide(double[] t1, double[] t2)
  2. divide(double[][] arr1, double[][] arr2)
  3. divide(double[][] numerator, double[][] denominator)
  4. divide(final double[] numerators, final double[] denominators)
  5. divide(final double[] v1, final double[] v2)
  6. divide(float[][] a, float num)
  7. divide(float[][][][] img, float val)
  8. divide(int[] array1, int[] array2)
  9. divide(long[] array, double value)