int i = *(int*)&x; doesn't convert x to int - what it does is get the actual bits of float x , which is usually represented as a whole other 4-byte value than you expected.
For reference, doing this is very bad if you do not know exactly how the float values ββare represented in memory.
source share