How many words exist in the format of the simple precision IEEE 754 standard to represent the NaN value?

  • 1
    $\begingroup$ What do you think? Have you tried reading some documentation on the standard? $\endgroup$ – Yuval Filmus Dec 13 '16 at 10:11

From this link you should be able to come up with a general solution: https://en.m.wikipedia.org/wiki/IEEE_754-1985

Why should it be general? Because it could work for both 32 and 64 bit numbers. The sign is X, the exponent is Y, the fraction is anything but all P's.

You just need to fill in X, Y, P (which is found on the wikipedia page) and come up with a general formula. This is a combinatorics problem. How many ways can you construct a binary string of size N that is not all zeros?

| cite | improve this answer | |
  • $\begingroup$ Thanks for posting an answer that encourages the asker to think for themself, and not just doing their homework for them. $\endgroup$ – David Richerby Dec 13 '16 at 12:46
  • $\begingroup$ Thanks, your explanation was my first approachment, so will be 2^23-1+2 ? 2^23 for all the possible combinations of the 23 bits that are in mantissa. -1 for subtract the mantissa with all zeros.. +2 for the two posible combinations of the first signed bit. $\endgroup$ – Kevin López Dec 13 '16 at 14:50
  • $\begingroup$ @DavidRicherby My intention was not to that other people solve my homework, I only wanted to know if a more experienced user than me in this subject, thinks in the same way as me to solve the problem. Sorry if when you readed my post, made you to think in this manner.If it's needed and not helpful for other users I can delete the post. $\endgroup$ – Kevin López Dec 13 '16 at 15:11

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