Java BigDecimal Subtract sub(BigDecimal d1, BigDecimal d2)

Here you can find the source of sub(BigDecimal d1, BigDecimal d2)

Description

sub

License

Apache License

Declaration

public static BigDecimal sub(BigDecimal d1, BigDecimal d2) 

Method Source Code


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

import java.math.BigDecimal;

public class Main {

    public static double sub(double d1, double d2) {
        BigDecimal b1 = new BigDecimal(Double.toString(d1));
        BigDecimal b2 = new BigDecimal(Double.toString(d2));
        return b1.subtract(b2).doubleValue();

    }/*  w  w w .jav a2s.c  om*/

    public static BigDecimal sub(BigDecimal d1, BigDecimal d2) {
        return d1.subtract(d2);
    }
}

Related

  1. sub(BigDecimal b1, BigDecimal b2)
  2. sub(BigDecimal v1, BigDecimal v2)
  3. sub(BigDecimal v1, BigDecimal v2)
  4. subtract(BigDecimal a, BigDecimal b)
  5. subtract(BigDecimal a, BigDecimal b)