# Question about errors in Numerical Analysis

#### evinda

##### Well-known member
MHB Site Helper
Hey!!! I am looking at an exercise in Numerical Analysis and I got stuck.
Why do we have a huge error when we substact two almost equal numbers?

#### Klaas van Aarsen

##### MHB Seeker
Staff member
Hey!!! I am looking at an exercise in Numerical Analysis and I got stuck.
Why do we have a huge error when we substact two almost equal numbers?
Hey evinda!

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?

#### evinda

##### Well-known member
MHB Site Helper
Great...I got it...Thank you very much!!!