I just tried debugging it then, and it seems that:
a = 0.699999988
and in the if statement, it compares:
0.6999999999996 > 0.699999988 (a)
I don't know exactly why this happens though but its just because its converting between double and float incorrectly I think
because its converting between double and float incorrectly I think
No, that's not the reason.
It's because both double and float store the value in binary, rather than decimal.
In neither case is it possible to exactly represent the decimal value 0.7 in binary. So we have two approximations to the actual value, the double is more precise, and therefore different to the float.