Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: What am I missing here?
Date: Sun, 27 Jan 2013 01:53:06 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 6
Message-ID: <ke21a2$klr$1@newscl01ah.mathworks.com>
References: <e0cb6636-306e-4239-a3c6-be062decdcea@googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1359251586 21179 172.30.248.48 (27 Jan 2013 01:53:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 27 Jan 2013 01:53:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:787465

Gautam Sethi <gautamsethi@gmail.com> wrote in message <e0cb6636-306e-4239-a3c6-be062decdcea@googlegroups.com>...
> Folks, this is driving me nuts! Can someone explain what may be going on? ......
- - - - - - - - -
  Welcome to the world of binary arithmetic, which is what your computer is using.  It cannot get an exact result for .1, .2, .3, and .4, just as your decimal calculator cannot get an exact result for 1/3.  All of your findings stem from that and the different roundings that are a consequence.  Remember that the "=="  and 'intersect' operations expect exact equality right down to the smallest bit.

Roger Stafford