Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!columbine.singnet.com.sg!not-for-mail
From: "sun" <sun@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Very simple number equation does not equate.
Date: Sun, 5 Jul 2009 23:54:52 +0800
Organization: Singapore Telecommunications Ltd
Lines: 29
Message-ID: <h2qav3$7um$1@reader01.singnet.com.sg>
NNTP-Posting-Host: 121.6.21.71
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1933
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1933
Xref: news.mathworks.com comp.soft-sys.matlab:552894


Dear matlab gurus,

I encountered a very puzzling problem. 0.2+0.2+0.2+0.15+0.05 clearly adds up
to 0.8. But on matlab R2007b, it does not equate. Why? I have been tearing
my hair apart as this problem looks so simple and yet elusive. Could some
matlab guru enlighten a newbie like me?

Below are what appears on my matlab screen;

>> 0.2+0.2+0.2+0.15+0.05==0.8

ans =

     0

>> 0.2+0.2+0.2+0.14+0.06==0.8

ans =

     1


>> 0.2+0.2+0.2+0.2==0.8

ans =

     1