Original Post
This came up in a thread that is a bit esoteric so I thought it might be worth repeating in a seperate thread...
Quote:It provides a nice easy way to inspect how a floating point number is stored and play with them. If you're going to use floating point heavy then you should understand them along the same lines as you understand integer.
Original post by Dredge-Master Assuming Little Edian (Edit: I've put Big Edian next to it in comments, just swap the values - on an 0x8086 based processor you should be using little edian so just leave the code as is). typedef union { float f; struct float_bits { unsigned int mantissa : 23; // negative:1 unsigned int exponent : 8; // exponent:8 unsigned int negative : 1; // mantissa:23 } ieee_bits; } ieee754_float;