-
double as a counter
i am getting funny results when i use a double as a counter
Dim counter As Double
For counter = 0 To 10 Step 0.1
Debug.Print counter
Next counter
it works alright up to 5.9 then it goes to 5.99999999999999 and the error carries over.
even though its not a large error i can't see why it goes it.
any ideas?
-
Why would you want to use a double as a counter ?
-
-
thanks kayjay those links really helped
in reply to plenderj it seamed like a good idea at the time as i neaded to step in steps of 0.01 i was intergrating a funtion using that step length
-
Well you could loop with a Long and just pass the counter / 100 as the parameter or something ?