如此简单
float a = 104.5;
NSLog(@"%X", *(int*)&a); // 42D10000
—— 来自 欧阳大哥
验证:
https://www.23bei.com/tool-15.html#
另一种方式
union u{
float f;
int i;
}u;
u.f = 104.5;
printf("%X",u.i); //42D10000
u.i = 0x42D10000;
printf("%f",u,f); //104.500000
一款轻量级的布局框架
https://github.com/xjh093/JHFrameLayout