Java tutorial
//package com.java2s; import java.math.BigDecimal; public class Main { public static double subtract(double d1, double d2) { BigDecimal b1 = new BigDecimal(Double.toString(d1)); BigDecimal b2 = new BigDecimal(Double.toString(d2)); return b1.subtract(b2).doubleValue(); } }