Java Array Subtract subtract(double[] res, double[] subtractor)

Here you can find the source of subtract(double[] res, double[] subtractor)

Description

Subtract two arrays

License

Open Source License

Parameter

Parameter Description

Return

difference array

Declaration

public static double[] subtract(double[] res, double[] subtractor) 

Method Source Code

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

public class Main {
    /**/*from   ww w .j a va 2s. com*/
     * Subtract two arrays
     * @param res: The minuend and the variable where the difference is stored
     * @param subtractor: the subtrahend
     * @return difference array
     */
    public static double[] subtract(double[] res, double[] subtractor) {
        for (int i = 0; i < res.length; i++) {
            res[i] -= subtractor[i];
        }
        return res;
    }
}

Related

  1. subtract(double[] array, double value)
  2. subtract(double[] first, double[] second)
  3. subtract(double[] first, double[] second, double[] out)
  4. subtract(double[] flowFrom, double[] flowTo)
  5. subtract(double[] p1, double[] p2)
  6. subtract(double[] values, double value)
  7. subtract(double[] x, double c)
  8. subtract(double[][] a, double[][] b)
  9. subtract(double[][] a, double[][] b)