So I've basically got this code
#include <stdio.h>
int main()
{
int n = 0x7fffffff;
float f = n;
printf("%d\n", n);
printf("%f\n", f);
n = 0x00ffffff;
f = n;
printf("%d\n", n);
printf("%f", f);
}
This gives this output:
> 2147483647
> 2147483648.000000
> 16777215
> 16777215.000000
Why the difference between the two first numbers, but not the second two numbers. I thought any integer can represented by any float in c. Why does this happen?