Java Number Add add(double v1, double v2)

Here you can find the source of add(double v1, double v2)

Description

add

License

Open Source License

Declaration

public static double add(double v1, double v2) 

Method Source Code


//package com.java2s;
import java.math.BigDecimal;

public class Main {

    public static double add(double v1, double v2) {
        BigDecimal b1 = new BigDecimal(Double.toString(v1));
        BigDecimal b2 = new BigDecimal(Double.toString(v2));
        return b1.add(b2).doubleValue();
    }//from www  . jav  a  2  s.  co  m

    public static String add(String v1, String v2) {
        BigDecimal b1 = new BigDecimal(v1);
        BigDecimal b2 = new BigDecimal(v2);
        return b1.add(b2).toString();
    }
}

Related

  1. add(double a, double b)
  2. add(Double a, Double b)
  3. add(Double v1, Double v2)
  4. add(double v1, double v2)
  5. add(Double v1, Double v2)
  6. add(Double v1, Double v2)