because for floating point numbers 0.8 does not really means 0.8 but it is 0.799999999 so it happens
Why it is 0.79999999
This depends on the storage of a float value. The decimal values will be stored in binary form (....,2^3,2^2,2^1,2^0,.,2^-1,2^-2,2^-3,...)
So, when 0.8 is stored in multiples of 2 as .101b(which is not 0.8 but 0.799999988).Hence its value will be less than 0.8.
if (a > 0.8)
is also False
thats why.
for your result try
if (a == 0.8f)