So I am trying to return the exponent value for f. If x is infinity or NaN I need to return Tmax. f is to be interpreted as the bit-level representations of single-precision floating point values and yes I mean to pass in an unsigned variable. I know I need to remove the appropriate value for the bias. I just cant figure out how. I can use any operations I want but only 8 of them (= does not count).
int float_exp(unsigned uf) {
int mask = 2139095040;
int hold;
hold = uf & mask;
if(mask == hold){
return Tmax;
} else {
return ;// something here???
}
}
I cant figure out how to get the exponent. Any help would be appreciated!