public class doublePrecision { public static void main(String[] args) { double total = 0; total += 5.6; total += 5.8; System.out
You're running up against the precision limitation of type double.
Java.Math has some arbitrary-precision arithmetic facilities.