How does x+y = x for non-zero value of y in floating-point arithmetic?

204 Views Asked by At

So, as the question asks, is we have only normalised floating-point values and normalised results, could you please explain how x + y = x?

I know it all relates to precision, but how can I explain that?

1

There are 1 best solutions below

3
On BEST ANSWER

Suppose you have a floating-point system which keeps track of, say, two decimal digits. If $x=1.0 \times 10^0$ and $y=3.4 \times 10^{-10}$, then the exact value of $x+y$ is $1.00000000034$, which would be represented in your system by the closest floating-point number, which is... Well, what is it?