IEEE-754 General Issues

386 Views Asked by At

I read the documents of the IEEE-754 and I could not understand some things

1) Is it possible to represent any number using this method? I know there are a number of final states, and there are infinite possibilities then no, but if there is a more detailed explanation of why?

2)Why can not represent the number zero? And how I represent it?

3) Why I dont need to represent 1 in representation of floating point number, I know its normalized, but normalized mean only 1 in the left side of the number? or everynumber, for example $8.3131e^{-1}$


Thanks!

3

There are 3 best solutions below

0
On BEST ANSWER
  1. You can't represent every number as the language is countable and there are uncountably many numbers. More to the point, you can't even represent $1/10$ since $$\frac{1}{10} = \frac{1}{2} \sum _{n=1}^{\infty } \frac{3}{16^n}.$$ This is exactly why computations like $0.1 + 0.2 - 0.3$ tend to yield results around $10^{-16}$, rather than exactly zero. More generally, you cannot exactly represent a number with an infinite binary expansion.

  2. You can represent zero. The fraction and exponent fields must contain all zeros and the sign field can be zero or one.

  3. Of course, 1 needs (and has) a representation.

1
On

1) Using $64$ bits, you can represent at most $2^{64}$ numbers exactly. Many more can be represented with sufficient accuracy for applications. Very very large numbers, such as $10^{1000}$ get represented as infinity (which may also be enough for applications).

2) $0$ is represented by all bits being zero.

3) I don't really understand this question, but you can use this conversion tool to find the IEEE-754 representation of $1$, or other numbers.

1
On

1) No. Eg. if you want to represent $10^{50} + 1$ and $10^{50} + 2$ they're going to be the same in terms of floating points with not enough bits.

2) You have numbers in from $(-1)^{sign} (1 + \frac{mantisa}{2^{bitsofmantisa}}) 2^{exponent-bias}$ how would you express 0? You have to have special value of exponent for this.

3) For 1 you just don't have any positive bits in mantisa...