Impossible to loop on a range with a float step #3810
Labels
About GAML
This issue concerns the GAML language
😱 Bug
The issue reveals a bug in GAMA
🤗 Enhancement
This is a request for enhancement
👍 Fix to be tested
Milestone
Describe the bug
Somewhere between a bug and an enhancement request. Currently the loop statement used with facets
from
to
andstep
assumes integers as values and casts the floats into int. But why ? It is very inconvenient if you have to convert your range into an integer range to initialise the loop and then do the conversion back to your float working value inside the loop. It also leads to infinite loops if thestep
value in]-1, 1[
as it's going to be casted to 0. The worst part is that there's no warning when giving a float to those facets that the values are going to be casted to int.To Reproduce
Steps to reproduce the behavior:
i
's value is1
instead of1.5
Expected behavior
Either the loop accepts floats, or at least it gives warning for the casting it is going to do
The text was updated successfully, but these errors were encountered: