Float_abs - return bit-level equivalent of absolute value of f for * floating point argument f. * both the argument and result are passed as unsigned int's, but * they are to be interpreted as the bit-level representations of * single-precision floating point values. * when argument is nan, return argument.. * legal ops: any integer/unsigned operations incl. ||, &&. also if, while * max ops: 10 * rating: 2

Respuesta :

#include <stdio.h>

int main(void) {

            // your code goes here

            //unsigned a =float_times_four(0x80000000);

            unsigned float_times_four(unsigned uf){

                unsigned expn = (uf >> 23) & 0xFF;

                printf(expn);

                unsigned sign = uf & 0x80000000;

                unsigned frac = uf & 0x007FFFFF;

                if(expn == 255 ||(expn == 0 && frac ==0))

                    return uf;

                if(expn){

                    expn<<2;

                }else if(frac == 0x007FFFFF){

//here 0x7FFFFF given by you that is wrong you place this 0x007FFFFF will excute

                    frac>>2;

                    expn<<2;

                }else{

                    frac<<=2;

                }

return (sign) | (expn <<23) | (frac);

            }

            return 0;

}