## Related questions with answers

For which positive integers k can the number $5 + 2 ^ { - k }$ be represented exactly (with no rounding error) in double precision floating point arithmetic?

Solution

VerifiedWe are looking for positive integers $k$ such that the number $5 + 2^{-k}$ can be represented exactly with no rounding error in double precision floating point arithmetic.

We have

$\begin{align*} \left( 5 \right)_{10} &= (101)_{2} \\ &= (1.01 \times 2^{2})_{2}. \end{align*}$

Thus,

$\begin{align*} 5 + 2^{-k} &= 1.01 \times 2^{2} + 1 \times 2^{-k} \\ &= 1.01 \times 2^{2} + 1 \times 2^{-k-2} 2^{2} \\ &= (1.01 + 1 \times 2^{-k-2} ) \times 2^{2} . \end{align*}$

Then, as the number $5 + 2^{-k}$ can be represented exactly with no rounding error in double precision floating point arithmetic, we have

$fl(5 + 2^{-k} ) = 5 + 2^{-k} .$

So, we can Add 1 as bit $3,4,\ldots,52$ of the mantissa.

Hence,

$2^{-k-2} \geq \epsilon_{mach}$

$2^{-k-2} \geq 2^{-52}$

Therefore,

$k+ 2 \leq 52$

$k \leq 50$

As we are looking for positive integers, then

$0 \leq k \leq 50 .$

## Create a free account to view solutions

## Create a free account to view solutions

## Recommended textbook solutions

#### Numerical Analysis

9th Edition•ISBN: 9780538733519J. Douglas Faires, Richard L. Burden#### Numerical Analysis

9th Edition•ISBN: 9780538735636J. Douglas Faires, Richard L. Burden## More related questions

1/4

1/7