#include<iostream>
using namespace std;
union ufloat{
float f;
unsigned u;
};
int main()
{
ufloat a;
a.f = -9.125f;
unsigned os = 1;
for(int i=sizeof(unsigned)*8-1;i>=0;i--)
{
cout<<((a.u>>i) & os)<<" ";
}
cout<<endl;
return 0;
}
c/c++ 打印float的二进制表示
最新推荐文章于 2023-06-10 04:36:54 发布