Kinds of Errors in Numerical Procedures

Errors can occur in doing numerical procedures
>> format long e
>> 2.6+0.2
ans =     2.800000000000000e+00
>> ans+0.2
ans =     3.000000000000000e+00
>> ans+0.2
ans =     3.200000000000001e+00
Repeated addition of the perfectly reasonable fraction results in the creation of an erroneous digit.
>> 2.6+0.6
ans =     3.200000000000000e+00
>> ans+0.6
ans =     3.800000000000000e+00
>> ans+0.6
ans =     4.400000000000000e+00
>> ans+0.6
ans =     5
Not only is there no apparent loss of precision, but MATLAB displays the final results as 5, as integer. This behaviors are caused by the finite arithmetic used in numerical computations.

Computers use only a fixed number of digits to represent a number. As a result, the numerical values stored in a computer are said to have finite precision. Limiting precision has the desirable effects of increasing the speed of numerical calculations and reducing memory required to store numbers. What are the undesirable effects?

Kinds of Errors:

Cem Ozdogan 2010-10-09