1. ## floating point representation

For each of the following expressions state the minimum number of digits your floating point representation must have in order to obtain the correct result.
i) $\displaystyle (1/{100}+100)-100$
ii) $\displaystyle 1/{100}+(100-100)$
I know this is something very simple but I am stuck. Is not the answer just $\displaystyle 0.01$

2. Originally Posted by charikaar
For each of the following expressions state the minimum number of digits your floating point representation must have in order to obtain the correct result.
i) $\displaystyle (1/{100}+100)-100$
ii) $\displaystyle 1/{100}+(100-100)$
I know this is something very simple but I am stuck. Is not the answer just $\displaystyle 0.01$
Well, for one thing, the answer cannot possibly be "0.01" because the question asks for "number of digits", an integer. If you meant "2 digits", that is not correct for both problems- there are two different answers here.

How many digits are required to accurately represent 1/100+ 100? The point of this exercise is that the order in which you do operations can affect the accuracy on a machine with limited storage.