Opinions on reliability/viability of doing something like this to workaround IEEE oddities in addition and subtraction etc...? I want to avoid BigDecimal,Formatters,etc... GC overheadexploring this idea.int fivePlaces = 100000;Assert.assertEquals(1.13269, add(1.13270, -0.00001, fivePlaces), 0);private double add(double aPrice,                   double aModifier,                   double aPrecision) {    long price = (long) (aPrice * aPrecision);    long modifier= (long) (aModifier * aPrecision);    long adjustedPrice = price + modifier;    return adjustedPrice / aPrecision;}for example:    double d = 1.30784;    double d2 = -0.00005;    double d3 = d + d2;    double d4 = add(d, d2, 100000);    System.out.println(d3);    System.out.println(d4);the idea is to avoid this result:1.3077899999999998and get this one:1.30778with primitives.
opinions on primitive double to long addition and back again to double?
java;performance