public class doublePrecision { public static void main(String[] args) { double total = 0; total += 5.6; total += 5.8; System.out
Use java.math.BigDecimal
Doubles are binary fractions internally, so they sometimes cannot represent decimal fractions to the exact decimal.