float num = 0.5;
double num2 = 0.5;
if( num == num2)
printf("Equal");
else
printf("Not Equal");
How is it possible?
- The binary value of float 0.5 is
00111111 00000000 00000000 00000000
- The binary value of double 0.5 is
00111111 11100000 00000000 00000000 00000000 00000000 00000000 00000000
Please explain step by step because I'm new to programming