iOS 10进制转IEEE-754浮点数十六进制

如此简单

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


发布了201 篇原创文章 · 获赞 220 · 访问量 19万+

猜你喜欢

转载自blog.csdn.net/xjh093/article/details/103696956
今日推荐