Java Array Divide arrayDivide(double[] a, double[] b)

Here you can find the source of arrayDivide(double[] a, double[] b)

Description

Divides two vectors of doubles, array-wise.

License

Open Source License

Parameter

Parameter Description
a - the first vector of doubles.
b - the second vector of doubles.

Return

the result of dividing two vectors of doubles.

Declaration


public static double[] arrayDivide(double[] a, double[] b) 

Method Source Code

//package com.java2s;

public class Main {
    /**//from  www. ja  va  2 s . c o  m
     * Divides two vectors of doubles, array-wise.
     * @param a - the first vector of doubles.
     * @param b - the second vector of doubles.
     * @return the result of dividing two vectors of doubles.
     */

    public static double[] arrayDivide(double[] a, double[] b) {
        double[] out = new double[a.length];
        for (int i = 0; i < a.length; i++) {
            out[i] = a[i] / b[i];
        }
        return out;
    }
}

Related

  1. arrayDivide(double[] d1, double denominator)
  2. arrayDivision(double[] array, double number)
  3. div(double a, double[] b)
  4. div(final int[] result, final int[] vector, final int[] scale)