Path: news.mathworks.com!not-for-mail
From: "Paul " <palex71@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Inexact output
Date: Thu, 23 Jun 2011 04:36:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 18
Message-ID: <itufrk$gc3$1@newscl01ah.mathworks.com>
References: <itu0eh$9hb$1@newscl01ah.mathworks.com> <itu0vd$asq$1@newscl01ah.mathworks.com>
Reply-To: "Paul " <palex71@hotmail.com>
NNTP-Posting-Host: www-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1308803765 16771 172.30.248.47 (23 Jun 2011 04:36:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 23 Jun 2011 04:36:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2380237
Xref: news.mathworks.com comp.soft-sys.matlab:733332

"Roger Stafford" wrote in message <itu0vd$asq$1@newscl01ah.mathworks.com>...
> "Paul " <palex71@hotmail.com> wrote in message <itu0eh$9hb$1@newscl01ah.mathworks.com>...
> > If I am doing a calculation, and the result is
> > 
> > 9.699999999999999
> > 
> > when it should be exactly 9.7, what can I do to correct it?
> > 
> > Thanks!
> - - - - - - - - - - -
>   Welcome to the binary world!  Your computer is using binary double precision floating point numbers and as such it cannot represent the decimal fraction 9.7 exactly.  What you see there is about as close as it can get.  To get some idea of the problem try representing 1/3 as an exact decimal fraction.
> 
> Roger Stafford


Right... what I need is to convert the output to 9.7 so that it is equal to a 9.7 value read from another file (so conditional=true).  Any ideas?

Thanks again.