Here you can find the source of add(double v1, double v2)
public static double add(double v1, double v2)
//package com.java2s; //License from project: Open Source License 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(); }/* ww w . j a v a2s .c o m*/ public static String add(String v1, String v2) { BigDecimal b1 = new BigDecimal(v1); BigDecimal b2 = new BigDecimal(v2); return b1.add(b2).toString(); } public static String toString(Object object, String defaultvalue) { if (object == null) { return defaultvalue; } if (object instanceof String) { return (String) object; } return object.toString(); } public static String toString(Object[] obj) { if (obj == null) { return null; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < obj.length; i++) { sb.append(obj[i]); if (i < obj.length - 1) { sb.append(","); } } return sb.toString(); } }