There are some cases of int to float casting, I found the original value changes.
For example:
int x = 49941310;
float y = (float) (x);
int z = (int) (y);
printf("%d, %f, %d",x,y,z);
Expecting: 49941310, 49941310.0000, 49941310...
Actual: 49941310, 49941312.0000, 49941312...
In case of 18595769 I get 18595768.
I also tried static_cast in c++, same things happened. I know 23 bits to store the mantissa and 9 to store the sign and exponent. My question is, If I want original value back what should I do?