so I got a task where I have to extract the sign, exponent and mantissa from a floating point number given as uint32_t. I have to do that in C and as you might expect, how do I do that ?
For the sign I would search for the MSB (Most Significant Bit, since it tells me whether my number is positive or negative, depending if it's 0 or 1)
Or let's get straight to my idea, can I "splice" my 32 bit number into three parts ?
Get the 1 bit for msb/sign Then after that follows 1 byte which stands for the exponent and at last 23 bits for the mantissa
It probably doesn't work like that but can you give me a hint/solution ? I know of freexp, but I want an alternative, where I learn a little more of C. Thank you.