Loops/Wrong ranges

You are encouraged to solve this task according to the task description, using any language you may know.
Some languages have syntax or function(s) to generate a range of numeric values from a start value, a stop value, and an increment.

The purpose of this task is to select the range syntax/function that would generate at least two increasing numbers when given a stop value more than the start value and a positive increment of less than half the difference.   You are then to use that same syntax/function but with different parameters; and show, here, what would happen.

Use these values if possible:



start 
stop 
increment 
Comment


 -2
2
1
Normal


 -2
2
0
Zero increment


 -2
2
-1
Increments away from stop value


 -2
2
10
First increment is beyond stop value


2
-2
1
Start more than stop: positive increment


2
2
1
Start equal stop: positive increment


2
2
-1
Start equal stop: negative increment


2
2
0
Start equal stop: zero increment


0
0
0
Start equal stop equal zero: zero increment

Related tasks

   Loop over multiple arrays simultaneously
   Loops/Break
   Loops/Continue
   Loops/Do-while
   Loops/Downward for
   Loops/For
   Loops/For with a specified step
   Loops/Foreach
   Loops/Increment loop index within loop body
   Loops/Infinite
   Loops/N plus one half
   Loops/Nested
   Loops/While
   Loops/with multiple ranges
   Loops/Wrong ranges


/*REXX program demonstrates several versions of  DO  loops with  "unusual"  iterations. */
@.=;      @.1=  '  -2      2       1  '      /*"normal".                                */
          @.2=  '  -2      2       0  '      /*"normal",                zero  increment.*/
          @.3=  '  -2      2      -1  '      /*increases away from stop, neg  increment.*/
          @.4=  '  -2      2      10  '      /*1st increment > stop, positive increment.*/
          @.5=  '   2     -2       1  '      /*start > stop,         positive increment.*/
          @.6=  '   2      2       1  '      /*start equals stop,    positive increment.*/
          @.7=  '   2      2      -1  '      /*start equals stop,    negative increment.*/
          @.8=  '   2      2       0  '      /*start equals stop,       zero  increment.*/
          @.9=  '   0      0       0  '      /*start equals stop,       zero  increment.*/
zLim= 10                                     /*a limit to check for runaway (race) loop.*/
                                             /*a zero increment is not an error in REXX.*/
  do k=1  while  @.k\==''                    /*perform a  DO  loop with several ranges. */
  parse var   @.k    x  y  z  .              /*obtain the three values for a DO loop.   */
  say
  say center('start of performing DO loop number '   k   " with range: "  x y z,  79, '═')
  zz= 0
        do  j=x   to y   by z   until zz>=zLim           /* ◄───  perform the  DO  loop.*/
        say '   j ───►'  right(j, max(3, length(j) ) )   /*right justify J for alignment*/
        if z==0  then zz= zz + 1                         /*if zero inc, count happenings*/
        end   /*j*/
 
  if zz>=zLim  then say 'the DO loop for the '    k    " entry was terminated (runaway)."
  say center(' end  of performing DO loop number '   k   " with range: "  x y z,  79, '─')
  say
  end         /*k*/                              /*stick a fork in it,  we're all done. */