public class doublePrecision { public static void main(String[] args) { double total = 0; total += 5.6; total += 5.8; System.out
Pretty sure you could've made that into a three line example. :)
If you want exact precision, use BigDecimal. Otherwise, you can use ints multiplied by 10 ^ whatever precision you want.