Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef union {
- float value;
- struct {
- unsigned int mantissa:23;
- unsigned int exponent:8;
- unsigned int negative:1;
- };
- } ieee754_float_t;
- ieee754_float_t f = (ieee754_float_t) 42.f;
- printf("mantissa = %u, exponent = %u, negative = %u", f.mantissa, f.exponent, f.negative);
- // mantissa = 2621440, exponent = 132, negative = 0
Add Comment
Please, Sign In to add comment