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