Java BigDecimal Subtract subtract(Vector a, Vector b)

Here you can find the source of subtract(Vector a, Vector b)

Description

subtract

License

Open Source License

Declaration

public static Vector<BigDecimal> subtract(Vector<BigDecimal> a, Vector<BigDecimal> b) 

Method Source Code


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

import java.math.BigDecimal;

import java.util.Vector;

public class Main {
    public static Vector<BigDecimal> subtract(Vector<BigDecimal> a, Vector<BigDecimal> b) {
        int m = a.size();

        Vector<BigDecimal> c = new Vector(m);

        for (int i = 0; i < m; i++) {
            BigDecimal value = ((BigDecimal) a.elementAt(i)).subtract((BigDecimal) b.elementAt(i));
            c.add(value);/*from   www . j  a  va2 s . c om*/
        }
        return c;
    }

    /***                         ***/

    // TODO: write vector class that incorporates most vector operations
    public static Vector<BigDecimal> add(Vector<BigDecimal> a, Vector<BigDecimal> b) {
        int m = a.size();
        Vector<BigDecimal> c = new Vector(m);
        for (int i = 0; i < m; i++) {
            BigDecimal value = ((BigDecimal) a.elementAt(i)).add((BigDecimal) b.elementAt(i));
            c.add(value);
        }
        return c;
    }
}

Related

  1. subtract(BigDecimal one, BigDecimal another)
  2. subtract(BigDecimal v1, BigDecimal v2)
  3. subtract(final BigDecimal baseAmount, final BigDecimal amountToSubtract)
  4. subtract(final BigDecimal start, final BigDecimal... values)
  5. subtract(float a, BigDecimal b_bd)
  6. subtract2Abs(BigDecimal aValue1, BigDecimal aValue2)
  7. subtractPercent(BigDecimal price, double amount)
  8. subtractQtde(BigDecimal val1, BigDecimal val2)
  9. subtractVatAmount(BigDecimal percentage, BigDecimal amount)