Originally Posted by
DanV2
Right, like iMalc mentioned, the while loops are for normalizing the mantissa of the result. The fraction part of an IEEE Floating point number should be 23 bits with an implied 1 bit, so the while loops shift right or left as necessary to normalize the result.
As for shifting the two FRAC values to the right, I'm not completely sure why we do, but the TA told us that it was necessary to truncate the values so that the result would fit into an integer. At least, that's what I remember from the explanation he gave.