Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!d8g2000yqf.googlegroups.com!not-for-mail
From: Blue Wizard <hdh6@cornell.edu>
Newsgroups: comp.soft-sys.matlab
Subject: building regular floating point vectors
Date: Wed, 16 Jun 2010 09:29:04 -0700 (PDT)
Organization: http://groups.google.com
Lines: 17
Message-ID: <c4fc258a-e911-466f-b736-f431f4704112@d8g2000yqf.googlegroups.com>
NNTP-Posting-Host: 192.88.94.254
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: posting.google.com 1276705744 2334 127.0.0.1 (16 Jun 2010 16:29:04 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 16 Jun 2010 16:29:04 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: d8g2000yqf.googlegroups.com; posting-host=192.88.94.254; 
	posting-account=Hm8hbAoAAADnSmgyzTG9Px2gh3Dv3pvB
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 
	Trident/4.0; GTB6.5; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 
	3.0.04506.30; .NET CLR 3.0.04506.648; InfoPath.2; .NET CLR 3.0.4506.2152; 
	.NET CLR 3.5.30729),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:645453

I wish to build a vector of increasing floating point number, all
separated by the same amount. I can do this either of the following
two ways:

delta is a floating point number, not necessarily whole
vec is a vector of floating point numbers, not necessarily whole
n is a floating point number but whole.

for the nth value

1)     vec(n)  = vec(n-1) + delta
2)     vec(n) = vec(1) + (n - 1) * delta

Question: The numbers delta and vec(1) might not be representable
exactly as binary numbers. Which method is more accurate in that
vec(n) is closest to the true value when the computation is performed
with floating point arithmetic. Thanks in advance.