Skip to content

Fixes #330 + #377 - #374

Merged
AlexisDrogoul merged 10 commits into
2024-06from
Fix-for-#330
Mar 15, 2025
Merged

AlexisDrogoul merged 10 commits into
2024-06from
Fix-for-#330

Conversation

@AlexisDrogoul

Copy link
Copy Markdown
Member

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.

Separates the int and float bounded definitions. Makes a loop where "from" > "to" at least execute once with the value of "from".
codescene-delta-analysis[bot]

This comment was marked as abuse.

@lesquoyb

Copy link
Copy Markdown
Contributor

while testing this PR I noticed that a from/to loop with from<to but a negative step ends up in an infinite loop.
It was happening before so I don't know if I should create a new issue or this can be solved here, what do you think ?

@AlexisDrogoul

Copy link
Copy Markdown
Member Author

while testing this PR I noticed that a from/to loop with from<to but a negative step ends up in an infinite loop. It was happening before so I don't know if I should create a new issue or this can be solved here, what do you think ?

Seems to me like a normal behavior 🤔

@lesquoyb

Copy link
Copy Markdown
Contributor

while testing this PR I noticed that a from/to loop with from<to but a negative step ends up in an infinite loop. It was happening before so I don't know if I should create a new issue or this can be solved here, what do you think ?

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
codescene-delta-analysis[bot]

This comment was marked as abuse.

The problem came from the choice of the operator + at compilation times, because step was not used to compute the type of i ...
codescene-delta-analysis[bot]

This comment was marked as abuse.

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
@AlexisDrogoul AlexisDrogoul changed the title Fixes #330 Fixes #330 + #337 Mar 15, 2025
@AlexisDrogoul
AlexisDrogoul merged commit 2cacee8 into 2024-06 Mar 15, 2025
@AlexisDrogoul
AlexisDrogoul deleted the Fix-for-#330 branch March 15, 2025 10:35
@lesquoyb lesquoyb changed the title Fixes #330 + #337 Fixes #330 + #377 Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Loop from/to has inconsistent behaviour

2 participants