%% From MathWorks User Community thread.
%
% http://www.mathworks.com/matlabcentral/newsreader/view_thread/261541
%
% As was discussed here not too long ago, the order in which
% one adds numbers represented by inexact floating point formats
% might have an impact on the magnitude of the error in the
% end result:
format long
v = rand(1000,1)
V = sort(v);
s = sum(v);
S = sum(V);
s-S % Should equal 0, s depends upon the order of v