C语言 位域编程
发布网友
发布时间:2022-04-24 01:50
我来回答
共1个回答
热心网友
时间:2023-07-17 02:35
#include <stdio.h>
union VALUE
{
float f;
struct{
unsigned int fraction: 23;
unsigned int exponent: 8;
unsigned int sign: 1;
} s;
};
int main()
{
VALUE v;
v.s.sign = 1;
v.s.fraction = 0;
v.s.exponent = 128;
printf("%f",v.f);
return 0;
}