2
$\begingroup$

How do I tell whether a particular IEEE 754 floating point number is a normalized floating point number? Is there some way to recognize an IEEE 754 normalized floating point number?

$\endgroup$
2
$\begingroup$

For single-precision floating-point numbers you need to check if the following condition holds for the exponent $e$: $0 < e < 255$. The exponent occupies bits $30 .. 23$ (including both ends) of a floating-point number.

For double-precision floating-point numbers you need to check if $0 < e < 2047$. The exponent occupies bits $62 .. 52$ in this case.

Essentially, for IEEE 754 floating-point numbers one has to check that the bits of the exponent are not all 1's and not all 0's. All zero bits correspond either to subnormal numbers or to signed zero. And when all bits of the exponent are ones it corresponds to $+\infty, -\infty$ or NaN (not a number).

$\endgroup$
  • $\begingroup$ This is entirely true. But, depending on your needs, you may need to also check zeros (there is a positive and a negative zero) which can be considered either as denormalised numbers (exponent=0), or as special cases. $\endgroup$ – TEMLIB Apr 23 '16 at 23:36
  • $\begingroup$ The question is about normalized numbers, but neither positive nor negative zeros are normalized. $\endgroup$ – Anton Trunov Apr 24 '16 at 6:03
  • 1
    $\begingroup$ This answer contains no explanation whatsoever. Since we're talking about computer science, we should be looking at floating point numbers expressed in any number of bits, not just some particular numbers of bits that are currently popular. $\endgroup$ – David Richerby Apr 24 '16 at 16:44
  • $\begingroup$ @DavidRicherby (1) The 1st version of the question contains a link to several 32-bit numbers (expressed in the hexadecimal format), and IEEE 754 is the standard de-facto in this area. (2) William Kahan [among the others] has put a lot of effort into designing the IEEE 754 standard. To numerical analysts it was a major breakthrough at the time. (3) I don't think it is possible to give a concrete answer without a specified format. $\endgroup$ – Anton Trunov Apr 24 '16 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.