Post Reply 
FOR LOOP "STEP" ?
02-02-2015, 07:38 AM
Post: #3
RE: FOR LOOP "STEP" ?
Hello

Quote:This is peculiar to say the least:

FOR A FROM 0 to pi STEP pi/6 DO
IF A == pi/3 then
print("IT NEVER GETS THERE!!!!!!");
END;
END;

Yes, you are correct! interestingly, if you print the successive values of A, you will see that the 2nd value is not what you would expect it to be.
The reason for it is that the 'step' is done in a full 15 digit precision add instead of a rounded 12 digit. This is what causes the issue.
Sorry about that.

cyrille
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
FOR LOOP "STEP" ? - DrD - 01-31-2015, 04:27 PM
RE: FOR LOOP "STEP" ? - Dieter - 01-31-2015, 06:50 PM
RE: FOR LOOP "STEP" ? - cyrille de brébisson - 02-02-2015 07:38 AM



User(s) browsing this thread: 1 Guest(s)