HomeHomeProductsProductsIDLIDLFor loop bug? IDL 8.2 & 8.1For loop bug? IDL 8.2 & 8.1
Previous
 
Next
New Post
4/17/2013 2:41 AM
 
Hi, I'm experiencing what looks like a bug, in a simple for loop:
IDL> for i=0.,1.9 do print,i 
0.00000 
1.00000 
2.00000 
I see this in IDL 8.2.2 and 8.1, but not in versions before. Can anybody confirm whether this is a bug, intended behaviour or something else?
 
New Post
4/17/2013 8:35 AM
 
At the very least it's a change in behavior.  It looks like the counter limit now uses a ceiling check instead of a floor.  A request has been made internally for some clarification.  Generally, of course, loops using non-integral values are to be avoided due to potential precision issues, but you're showing a different case completely that's unrelated.
 
New Post
4/19/2013 4:38 PM
 
The behavior of IDL in the case of FOR loops using floating point indexing will be addressed in a future release, returning it to its original state.
 
New Post
4/23/2013 4:10 AM
 
Thanks for checking Jim. And no, I wouldn't normally use this, but I was going through someone else's code when coming across this illogical behaviour.
 
Previous
 
Next
HomeHomeProductsProductsIDLIDLFor loop bug? IDL 8.2 & 8.1For loop bug? IDL 8.2 & 8.1


 


© 2014 Exelis Visual Information Solutions