Now, here is the function header of the function I\'m supposed to implement:
/* * float_from_int - Return bit-level equivalent of expression (float) x *
Dealing with 0x80000000 is pretty easy:
0x80000000
int xIsNegative = 0; unsigned int absValOfX = x; if (x < 0) { xIsNegative = 1; absValOfX = -(unsigned int)x; }
It gets rid of special casing -2147483648 since that value is representable as an unsigned value, and absValOfX should always be positive.
-2147483648
absValOfX