- Thread starter
- #1

- Apr 13, 2013

- 3,739

Why do we have a huge error when we substact two almost equal numbers?

- Thread starter evinda
- Start date

- Thread starter
- #1

- Apr 13, 2013

- 3,739

Why do we have a huge error when we substact two almost equal numbers?

- Admin
- #2

- Mar 5, 2012

- 9,025

Hey evinda!

Why do we have a huge error when we substact two almost equal numbers?

Suppose we calculate $1.000001 - 1$.

In a "float" you can only keep 7 significant digits, so the first number cannot have more reliable digits than it already has.

The accuracy of both numbers is $\pm 0.0000005$.

Or as a percentage: \(\displaystyle \frac{0.0000005}{1} \times 100\% = 0.00005 \%\), which is a pretty small error.

The result of the subtraction is $0.000001$, but its accuracy is still about $0.0000005$.

Or as a percentage \(\displaystyle \frac{0.0000005}{0.000001} \times 100\% = 50 \%\)

I'd say that is quite a large error relatively speaking. Don't you?

- Thread starter
- #3

- Apr 13, 2013

- 3,739

Great...I got it...Thank you very much!!!