Java Array Subtract subtract(float[] dividend, float[] divisor)

Here you can find the source of subtract(float[] dividend, float[] divisor)

Description

subtract

License

Open Source License

Declaration

public static float[] subtract(float[] dividend, float[] divisor) 

Method Source Code

//package com.java2s;
/*//from w  w w . j  a v a 2  s  .  c  o m
 * Copyright (c) 2008-2013 Maksim Khadkevich and Fondazione Bruno Kessler.
 *
 * This file is part of MART.
 * MART is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2, as published
 * by the Free Software Foundation.
 *
 * MART is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with MART; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

public class Main {
    public static float[] subtract(float[] dividend, float[] divisor) {
        float[] difference = new float[dividend.length];
        for (int i = 0; i < dividend.length; i++) {
            difference[i] = dividend[i] - divisor[i];
        }
        return difference;
    }

    public static float[] subtract(float[] dividend, float divisor) {
        float[] difference = new float[dividend.length];
        for (int i = 0; i < dividend.length; i++) {
            difference[i] = dividend[i] - divisor;
        }
        return difference;
    }
}

Related

  1. subtract(final double[] a, final double[] b, final double[] c)
  2. subtract(final double[] first, final double[] second)
  3. subtract(final double[] v1, final double[] v2)
  4. subtract(final double[] vector1, final double[] vector2)
  5. subtract(float a[][][], float b[][][])
  6. subtract(int a, int[] b)
  7. subtract(int bytesPerDim, int dim, byte[] a, byte[] b, byte[] result)
  8. subtract(int[] a, int[] b)
  9. subtract2(double[] v1, double[] v2, double[] res)