From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: BUG???: 'Sum' depends on the order of values in an array
Date: Wed, 29 Jun 2011 21:27:09 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 6
Message-ID: <iug5bd$q5f$>
References: <iug2ad$hta$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1309382829 26799 (29 Jun 2011 21:27:09 GMT)
NNTP-Posting-Date: Wed, 29 Jun 2011 21:27:09 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:734254

"David" wrote in message <iug2ad$hta$>...
> Got this peculiar problem that sum (and also prod) appears to depend on the order of the values in the array that is supposed to be summed up. .......
- - - - - - - - - - -
  You have no reason to suppose that in any computer's calculation of numbers where round off errors can occur, these will automatically give exactly the same net result for different orderings of operations.  All you can expect is that each such error is within the range expected of such errors.  This is a characteristic of all digital computing, not just matlab.

Roger Stafford