@Test public void testAdd() { Assert.assertEquals(ArithUtils.add(0d, 0d), 0.0, 10); Assert.assertEquals(ArithUtils.add(1.00001, 1.0001), 2.00011, 10); }
public static Double add(Double v1, Double v2) { checkArguments(v1, v2); BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); return b1.add(b2).doubleValue(); }
ArithUtils { public static Double add(Double v1, Double v2) { checkArguments(v1, v2); BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); return b1.add(b2).doubleValue(); } }
ArithUtils { public static Double add(Double v1, Double v2) { checkArguments(v1, v2); BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); return b1.add(b2).doubleValue(); } private  ArithUtils(); }
ArithUtils { public static Double add(Double v1, Double v2) { checkArguments(v1, v2); BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); return b1.add(b2).doubleValue(); } private  ArithUtils(); static Double add(Double v1, Double v2); static Double sub(Double v1, Double v2); static Double mul(Double v1, Double v2); static Double div(Double v1, Double v2); static Double div(Double v1, Double v2, int scale); static Double round(Double v, int scale); }
ArithUtils { public static Double add(Double v1, Double v2) { checkArguments(v1, v2); BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); return b1.add(b2).doubleValue(); } private  ArithUtils(); static Double add(Double v1, Double v2); static Double sub(Double v1, Double v2); static Double mul(Double v1, Double v2); static Double div(Double v1, Double v2); static Double div(Double v1, Double v2, int scale); static Double round(Double v, int scale);  }