Apparently you didn't bother reading the second part of my post, or the first
part even. I mentioned that my technique was only valid if he cared about
the mantissa.
What you actually -wrote- is quoted above. "[...] and only care about
the size of the fraction". "size of the fraction" is NOT the same
as the IEEE 754 definition of "mantissa". The OP's example
dealt with the decimal fractions, and you used the word "fraction"
yourself rather than clarifying that your shift proposal would deal
with the mantissa rather than the fraction. When you are dealing,
for example, with numbers in the 8192 range, the left-most bit of
the mantissa is nominating values in the 4096 range rather than
nominating a value in the range [0,1) as would be the case when
you use the word "fraction".
For very specific implementations, your algorithm could work for
comparing mantissas. But unless the OP has very specific precision
requirements, it would likely make more sense to use the standard C
function frexp() to extract the "normalized fraction and an integral
power of 2"; the drawback of that is that it works with double
rather than float and the mantissa of a double is -potentially-
completely different than the mantissa of a float representing
the same number. Historically, this did happen with more than
one major vendor, in the days before IEEE single precision
numbers became standardized (if I recall correctly, double
precision was standardized first and there was a noticable
lag before single precision was standardized.)