Java Array Divide div(float[] nums, float n)

Here you can find the source of div(float[] nums, float n)

Description

div

License

Apache License

Declaration

public static float[] div(float[] nums, float n) 

Method Source Code

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

import java.util.Arrays;

public class Main {
    public static float[] div(float[] nums, float n) {
        assert !Float.isInfinite(n) : "Trying to divide "
                + Arrays.toString(nums) + " by  " + n; // Almost surely not what you want
        for (int i = 0; i < nums.length; i++)
            nums[i] /= n;//from ww  w  .j a  va2 s  . c om
        return nums;
    }

    public static double[] div(double[] nums, double n) {
        assert !Double.isInfinite(n) : "Trying to divide "
                + Arrays.toString(nums) + " by  " + n; // Almost surely not what you want
        for (int i = 0; i < nums.length; i++)
            nums[i] /= n;
        return nums;
    }
}

Related

  1. arrayDivision(double[] array, double number)
  2. div(double a, double[] b)
  3. div(final int[] result, final int[] vector, final int[] scale)
  4. div(float[] items, int offset, int length, float divisor)
  5. div(float[] items, int offset, int length, float divisorX, float divisorY)
  6. div(float[] nums, int n)
  7. div(float[] nums, int n)
  8. div(float[] values, float divisor)
  9. div(int[]... vectors)