% This example computes a simple sum in two different ways.
% The results are different, showing that adding many small numbers to
% a large number can result in large errors.

format long

x=1;
for n=1:10000
  x=x+10^-16;
end
x

x=0;
for n=10000:-1:1
  x=x+10^-16;
end
x=x+1
