The following piece of code :
int main()
{
float a=0.7;
printf("%.10f %.10f\n",0.7, a);
return 0;
}
gives 0.7000000000 0.6999999881 as answer while the following piece of code :
int main()
{
float a=1.7;
printf("%.10f %.10f\n",1.7, a);
return 0;
}
gives 1.7000000000 1.7000000477 as output.
Why is that in the first case upon printing a I got a value less than 0.7 and in the second case more than 1.7?