floating point number system and geometric sum

41 Views Asked by At

In the floating point number system you can write a random number x as the following:

$$ x= (-1)^s \left(\sum_{i=0}^{m-1}d_i b^{-i}\right) \cdot 2^e$$ with $e \in \{e_{min},...,e_{max} \}, d_i \in \{0,...,b-1 \} $

For the mantissa holds then: $$ \sum_{i=0}^{m-1}d_i b^{-i} \leq \sum_{i=0}^{m-1}(b-1) b^{-i} = (b-1) \sum_{i=0}^{m-1}b^{-i} \overset{!}{=} b(1-b^{-m}) $$

But the formula for the geometric sum would imply:$$ b \frac{1-b^{-m}}{1-b}$$

Do you see the mistake?

2

There are 2 best solutions below

1
On BEST ANSWER

There is no contradiction.

$$(b-1) \sum_{i=0}^{m-1}b^{-i} =(b-1)\ b \frac{1-b^{-m}}{1-b}= b(1-b^{-m}).$$

1
On

The result is correct as stated; yours is wrong:

\begin{eqnarray} (b-1)\sum_{i=0}^{m-1}b^{-i} &=& (b-1)\sum_{i=0}^{m-1}\left(b^{-1}\right)^i \\ &=& (b-1)\frac{1-\left(b^{-1}\right)^m}{1-b^{-1}} \\ &=& b(b-1)\frac{1-\left(b^{-1}\right)^m}{b-1} \\ &=& b\left(1-b^{-m}\right)\;. \end{eqnarray}