So i have
$$x=\displaystyle\sum_{k=1}^{\infty}2^{-k}+\displaystyle\sum_{k=0}^{\infty}2^{-6k-1}$$
and i need to calculate relative error when approximating above x in $$MARC-32 \ \dots P(2,24,-127,127)$$ Hopefully the notation is understandable, basically it is a 32-bit computer that has base 2, significand is 24, exponents are in an interval [-127,127]
I know i will have to calculate: $$x_{-}, x_{+}, fl(x)$$ which are essential for calculating the relative error, but i believe that is not the hardest part(i used a notation by which i normally do this, so i apologize if it's not known by everyone)
I am stuck in changing the x in binary. I would appreciate the help.
The storage of this value will depend upon how you calculate it. If you are getting the computer to increase $k$ by one (through some sort of loop) and add the values to a total it will get a different answer to if you calculate the answer mathematically then try to store that.
Option 1 Do the math first then store the answer. Mathematically $x=\frac{95}{63}$. If you use the process in my answer to your other question you'll get:
$$\frac{95}{63}=1.100000100000100001000001...$$
The 25th bit after the binary point is a one so as we can only 24 bits after the point we need to work out if we round up or down. As it is a one we round up the 24th bit.
As we have a leading one the 24 bits of the significant are therefore: 1000010000010000100001. The exponent is clearly zero. The stored value is equal to: $$1+2^{-1}+2^{-7}+2^{-13}+2^{-19}+2^{-24}=\frac{25298977}{16777216}$$
This is slightly more than the value of $x$ by: $\frac{31}{1056964608}\approx3\times10^{-8}$.
Option 2 You get the computer to work it out using a loop similar to:
After the 4th loop the second term doesn't contribute anything as the terms $2^{-25}$ onwards are smaller than can be stored in total which is of the order of 1.
Carrying the loop out will end up storing you the value: $1.100000100000100000011111$ which is equal to: $$\frac{25298975}{16777216}$$ The difference comes because all values equal to or lower that $2^{-25}$ can not be added on.
This will give a value below the real value of $x$ by: $\frac{95}{1056964608}\approx9\times10^{-8}$.