Path: news.mathworks.com!not-for-mail
From: "Rick Rosson" <rrosson@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: significant digits
Date: Tue, 7 Aug 2007 09:14:45 -0400
Organization: The MathWorks, Inc.
Lines: 50
Message-ID: <f99r87$rff$1@fred.mathworks.com>
References: <f99qoe$h6e$1@fred.mathworks.com>
Reply-To: "Rick Rosson" <rrosson@mathworks.com>
NNTP-Posting-Host: rossonr.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1186492487 28143 144.212.206.185 (7 Aug 2007 13:14:47 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 7 Aug 2007 13:14:47 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
Xref: news.mathworks.com comp.soft-sys.matlab:422745



Hi Sunil,

It's not so much that there is a fixed number of significant figures, but 
rather that MATLAB (and almost all other computer languages) uses floating 
point representations based on the IEEE standards.

The absolute precision of a floating point variable depends on the absolute 
magnitude of the variable's current value.  For example:

    x = 1.5;
    y = 1.5e-9;
    e = eps(x);
    f = eps(y);

Notice that 'e' and 'f' are about 9 orders of magnitude apart.

On the other hand, the relative precision is approximately constant:

    a = e/x;
    b = f/x;

Notice that 'a' and 'b' are approximately equal.


For more information, type

   doc eps

at the MATLAB command prompt.  Also, take a look at Technical Note 1108:

   http://www.mathworks.com/support/tech-notes/1100/1108.html


I hope that helps.  Thanks.

Rick



"sunil vaidya" <sunil.vaidya@gmail.com> wrote in message 
news:f99qoe$h6e$1@fred.mathworks.com...
> i'm running a prog in matlab which uses two matrix
> inversions and one roots function. i have some inconsistency
> in my results. does matlab truncate numbers beyond 16
> significant digits? and if it does, is they any way around
> this problem----can the accuracy be increased or something?
> TIA