I'm trying to write a C program to find the smallest positive integer x so that (1/x) * x is not equal to 1, using single precision. And I do it again with double precision. I know that the x for single precision is 41, however when I test it by writing C code, I still get 1.00000
This is my test code
int main()
{
float x = 41;
float div = 1/x;
float test = div * x;
printf("%f\n", test);
}
I get 1.0000 instead of a 0.999999
printf("%.10f\n", test);