You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I noticed some weird behaviours/inconsistency of the loop statement with the syntax from/to
When doing a loop from 0 to 0 setting explicitly the step to 1, the loop goes through 0.0, a float, which is inconsistent with all the other cases where the type of the value over which we are iterating depends on those of from, to and step.
When doing a loop from 0 to -1 setting explicitly the step to 1, the loop doesn't execute the code inside, which to me makes sense but is inconsistent with the previous example where we go through the loop at least once with the initial value.
To Reproduce
Steps to reproduce the behavior:
Run this model:
model bugloopto
experiment a {
init {
write "from 0 to 1";
loop i from:0 to:1 step:1{
write i;
}
write "from 0 to 0";
loop i from:0 to:0 step:1{
write i;
}
write "from 0 to -1";
loop i from:0 to:-1 step:1{
write i;
}
}
}
See error
The text was updated successfully, but these errors were encountered:
Describe the bug
I noticed some weird behaviours/inconsistency of the
loop
statement with the syntax from/to0
to0
setting explicitly the step to1
, the loop goes through0.0
, a float, which is inconsistent with all the other cases where the type of the value over which we are iterating depends on those offrom
,to
andstep
.0
to-1
setting explicitly the step to1
, the loop doesn't execute the code inside, which to me makes sense but is inconsistent with the previous example where we go through the loop at least once with the initial value.To Reproduce
Steps to reproduce the behavior:
The text was updated successfully, but these errors were encountered: