X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 17 Apr 2013 02:41 AM by  anon
For loop bug? IDL 8.2 & 8.1
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
17 Apr 2013 02: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?

    Deleted User



    New Member


    Posts:
    New Member


    --
    17 Apr 2013 08: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.

    Deleted User



    New Member


    Posts:
    New Member


    --
    19 Apr 2013 04: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.

    Deleted User



    New Member


    Posts:
    New Member


    --
    23 Apr 2013 04: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.
    You are not authorized to post a reply.