Repository navigation
Fixes #330 + #377 - #374
Conversation
|
while testing this PR I noticed that a from/to loop with from<to but a negative step ends up in an infinite loop. |
Seems to me like a normal behavior 🤔 |
then we have another problem because in the other direction we just iterate once and exit the loop. I'm making a unit test model for loops because it seems like there are a lot of inconsistencies here |
- some models are not passing the tests right now do to bugs/inconsistencies in the loop statement
The problem came from the choice of the operator + at compilation times, because step was not used to compute the type of i ...
Correctly fall into infinite loop when from > to and step > 0 (or from < to and step < 0)
Simplifies from... to... loops
Simplifies again the IntBounded and FloatBounded classes
Separates the int and float bounded definitions. Makes a loop where "from" > "to" at least execute once with the value of "from". Should fix #330.