Re: An interesting problem
- From: "Steven Lord" <slord@xxxxxxxxxxxxx>
- Date: Mon, 11 May 2009 09:33:38 -0400
"umar " <umarkhan_80@xxxxxxxxxxx> wrote in message
news:gu8ibm$jb9$1@xxxxxxxxxxxxxxxxxxxxx
hi,
I tried the following code
i=0;
x=0;
for i=1:10
x=x+0.1
end
x-1
at the end x-1 should be zero, but it turns out to be -1.1102e-016 , WHY?
See Q6.1 in the newsgroup FAQ for an explanation and links to a few papers
that go into more depth on floating-point computation:
http://matlabwiki.mathworks.com/MATLAB_FAQ
--
Steve Lord
slord@xxxxxxxxxxxxx
.
- References:
- An interesting problem
- From: umar
- An interesting problem
- Prev by Date: Re: gridding data with NaNs
- Next by Date: Probability
- Previous by thread: Re: An interesting problem
- Next by thread: Help display temporary value of variable in vector
- Index(es):
Relevant Pages
|
Loading