What is NaN?

Short for Not a Number, a floating-point special value produced by operations with no numeric result, such as 0 ÷ 0 or the square root of a negative number. It has an all-ones exponent and a nonzero significand, and compares unequal even to itself.

Field: Computer Arithmetic

NaN in the explanations

Questions that mention NaN (6)

  1. When x is NaN, what does evaluating x == x give in most programming languages?
  2. In IEEE 754 single precision, if the stored exponent field is 130, what is the actual exponent (power of two)?
  3. Under IEEE 754, what result does the standard specify for dividing a positive number by zero?
  4. In IEEE 754 single precision, what do bit patterns with an all-ones exponent field (255) represent?
  5. In single precision, adding 1 to 100 million (10⁸) leaves the result unchanged at 100 million. Which explains this?
  6. What is the largest finite value representable in FP16 (1 sign, 5 exponent bits with bias 15, 10 significand bits)?

Related terms

IEEE 754 Significand Exponent field Arithmetic shift bfloat16 Booth's algorithm Carry-lookahead adder Carry-save adder Catastrophic cancellation Fixed point

Back to the glossary