Why do I get different results when printing out z as shown in the following code snippet?
It seems that the compiler cuts in the second "print" all positions after '2'...
Thank you for help!
double z = 1.0;
z = z + 0.1;
z = z + 0.1;
System.out.print("z := "+z);
System.out.print(" # z:= "+((0.1+0.1)+(1.0)));
Output:
z := 1.2000000000000002 # z:= 1.2