Java Array Subtract subtract(double[] p1, double[] p2)

Here you can find the source of subtract(double[] p1, double[] p2)

Description

subtract

License

Apache License

Declaration

public static double[] subtract(double[] p1, double[] p2) 

Method Source Code

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

public class Main {
    public static double[] subtract(double[] p1, double[] p2) {
        int nd = p1.length;
        double[] out = new double[nd];
        for (int d = 0; d < nd; d++) {
            out[d] = p1[d] - p2[d];//from www.ja  va2 s.c  om
        }
        return out;
    }

    public static double[] subtract(double[] p1, double[] p2, double[] out) {
        int nd = out.length;
        for (int d = 0; d < nd; d++) {
            out[d] = p1[d] - p2[d];
        }
        return out;
    }
}

Related

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