if(a == b) may be true or may not be, that’s because of the way floating point numbers are stored. Data type float takes 4 byte of memory and double takes 8 byte of memory. Float can have ( 8 bit unsigned integer) and a 23 bit fraction but double can have ( 11 bit exponent ) and a 52 bit fraction.