Possible Duplicate:
Retain precision with Doubles in java
Moving decimal places over in a double
For example, something as simple as this:
public class WrongAnswer {
public static void main(String[] args) {
System.out.println(100*1.1);
}
}
prints 110.00000000000001 instead of 110. Using other numbers instead of 100*1.1 also give a lot of digits with some random digit at the end that isn't right..
Any ideas?