Thread: Round off error
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Vergel Adriano Vergel Adriano is offline
external usenet poster
 
Posts: 857
Default Round off error

Harvey,

I'm not sure of what you mean by "eliminate roundoff" and what you expect
the loop to do, but the way you have it, it will go through the loop only
once and that's for the first value of -0.2. The next value will be 0.8
which is 0.2. If you specify a step value, you'll get more iterations:

Dim i As Double
For i = -0.2 To 0.2 Step 0.1
Debug.Print i
Next


"Harvey" wrote:

Anyone knows how to eliminate roundoff error in a loop?

Dim i as double
for i= - 0.2 to 0.2
debug.print i
next

Thanks:)