cout <* (float *) & amp; I & lt;
* (float *) & amp; Val: 1.54143 e-44
Val (float) : 11
Why is not the same as the two values is not very good. The first * (float *) & amp; I, I will address is converted into float *, out put value; Namely uint32_t data can be converted to a float, so why not directly (float) converts val?
CodePudding user response:
(float *) & amp; I, is the content that is stored in the memory I interpreted as float directly, because the format of the float and an int does not agree completely, so the error(float) I, is to put the plastic to float, the compiler will automatically help you convert,
CodePudding user response:
There is a special case:Float 0.0 f
And
Int 0
The same,
CodePudding user response:
1/f, said is very right, shaping and float memory allocation rules, you are so strong lu certainly disappear