I don't understand why are float values different from double values. From the example bellow it appears that float provides different result than double for the same operation:
public class Test {
public static void main(String[] args) {
double a = 99999.8d;
double b = 99999.65d;
System.out.println(a + b);
float a2 = 99999.8f;
float b2 = 99999.65f;
System.out.println(a2 + b2);
}
}
Output:
199999.45
199999.44
Can you explain what makes this difference between float and double?