In Java when I have used double numbers and when the values are as follows, the result is not correct. I can round this, but it will need to change in several places. What is the reason to have this result.
public static void main(String[] args) {
double a=300.0;
double b=24.08;
System.out.println(a*b);
}
The result is 7223.999999999999
.
But the actual result should have been 7224
.
But why?