Any thing you write in code must be stored in memory in binary form (0,1 form)
When you write float a=0.7 then a must get the binary value of 0.7.
In binary 0.7 is
b0.1011001100110011001100110011001100110011001100110011001100110...
However, 0.7 is a double-precision literal, whose value is 0.7 rounded to the closest representable double-precision value, which is:
b0.10110011001100110011001100110011001100110011001100110
In decimal, that's exactly:
0.6999999999999999555910790149937383830547332763671875
When you write float a = 0.7, that double value is rounded again to single-precision, and a gets the binary value:
b0.101100110011001100110011
which is exactly
0.699999988079071044921875
in decimal.
When you do the comparison (a < 0.7), you are comparing this single-precision value (converted to double, which does not round, because all single-precision values are representable in double precision) to the original double-precision value.
0.699999988079071044921875 < 0.6999999999999999555910790149937383830547332763671875
the comparison correctly returns true.
Please visit this link for Floating point airthmatic operation
Floating Point Airthmatic[
^]