Verification: Machine number immediately to right and left of $2^m$

813 Views Asked by At

The question I'm given is what are the machine numbers immediately to the right and left of $2^m$? How far is each from $2^m$?

I'm given the machine epsilon, $\epsilon$ is $2^{-23}$. (I believe we are working with 32 bit, 1 bit sign, 8 bit exponent, 23 bit mantissa).

Thus, my answer is: Smallest machine number to right of $2^m$: $2^m(1+\epsilon)$

(distance of $2^{m-23})$ and

Machine number immediately to left: $2^{m-1}(2-\epsilon)$. Is this correct or am I mistaken? Thank you.

1

There are 1 best solutions below

0
On BEST ANSWER

You're correct.

The immediate neighbors of $1$ are $1-\epsilon/2$ and $1+\epsilon$.

Therefore, the immediate neighbors of $2^m$ are $2^m(1-\epsilon/2)=2^{m-1}(2-\epsilon)$ and $2^m(1+\epsilon)$.