#1441 for loop does not end correctly

closed-fixed
nobody
5
2015-03-23
2014-07-08
Anonymous
No

This behavior is not documented in help iteration

Generally, the following command does not print anything as expected:
do for [i=2:0:2] {print i}
do for [i=3:1:2] {print i}

However, the following cases print results but they shouldn't
do for [i=3:2:2] {print i}
3
do for [i=6:4:3] {print i}
6
do for [i=12:10:3] {print i}
12

It seems that this strange behavior occur for start-increment < end <= start in the following code structure
do for [i=start,end,increment]

I am using:
Version 4.6 patchlevel 4 last modified 2013-10-02
Build System: Linux x86_64
Laptop Linux mint Debian Edition kernel 3.10-2-amd64

Possibly related to bugs #1429 and #1358

Discussion

  • rnavarro
    rnavarro
    2014-07-08

    • summary: for loop limits does not end correctly --> for loop does not end correctly
     
  • Ethan Merritt
    Ethan Merritt
    2014-07-12

    • status: open --> closed-fixed