PROGRAM FILE 44: ELEMENTARY USE OF THE FOR-STATEMENT.
    ANSI STANDARD 11.2, 11.4

SECTION 44.1: ELEMENTARY USE OF THE FOR-STATEMENT.

THIS SECTION TESTS A SIMPLE FOR-NEXT CONSTRUCTION WITH
A VARIETY OF VALUES FOR THE INITIAL-VALUE, LIMIT, AND
INCREMENT. TO PASS THE TEST, THE CONTROL-VARIABLE MUST
TAKE ON THE APPROPRIATE VALUES AND THE LOOP MUST BE EXECUTED
THE CORRECT NUMBER OF TIMES.

               BEGIN TEST.


LOOP IS: FOR I1= 9.87789E-2  TO  .09878  STEP  3.E-7 

CONTROL VARIABLE:
SHOULD BE      ACTUAL         RESULT
 9.87789E-2     9.87789E-2      OK  
 9.87792E-2     9.87792E-2      OK  
 9.87795E-2     9.87795E-2      OK  
 9.87798E-2     9.87798E-2      OK  
LOOP EXITED
 9.87801E-2     9.87801E-2      OK  

NO. TIMES THROUGH LOOP:
SHOULD BE:  4      ACTUAL:  4    RESULT:   OK  

-----------------------------------------------

LOOP IS: FOR I1= 5  TO  8  STEP -1 

CONTROL VARIABLE:
SHOULD BE      ACTUAL         RESULT
LOOP EXITED
 5              5               OK  

NO. TIMES THROUGH LOOP:
SHOULD BE:  0      ACTUAL:  0    RESULT:   OK  

-----------------------------------------------

LOOP IS: FOR I1= 8  TO  5  STEP  1 

CONTROL VARIABLE:
SHOULD BE      ACTUAL         RESULT
LOOP EXITED
 8              8               OK  

NO. TIMES THROUGH LOOP:
SHOULD BE:  0      ACTUAL:  0    RESULT:   OK  

-----------------------------------------------

LOOP IS: FOR I1= 8  TO -5  STEP -3 

CONTROL VARIABLE:
SHOULD BE      ACTUAL         RESULT
 8              8               OK  
 5              5               OK  
 2              2               OK  
-1             -1               OK  
-4             -4               OK  
LOOP EXITED
-7             -7               OK  

NO. TIMES THROUGH LOOP:
SHOULD BE:  5      ACTUAL:  5    RESULT:   OK  

-----------------------------------------------

LOOP IS: FOR I1=-1.7  TO  2.6  STEP  .27 

CONTROL VARIABLE:
SHOULD BE      ACTUAL         RESULT
-1.7           -1.7             OK  
-1.43          -1.43            OK  
-1.16          -1.16            OK  
-.89           -.89             OK  
-.62           -.62             OK  
-.35           -.35             OK  
-.08           -.08             OK  
 .19            .19             OK  
 .46            .46             OK  
 .73            .73             OK  
 1.             1.              OK  
 1.27           1.27            OK  
 1.54           1.54            OK  
 1.81           1.81            OK  
 2.08           2.08            OK  
 2.35           2.35            OK  
LOOP EXITED
 2.62           2.62            OK  

NO. TIMES THROUGH LOOP:
SHOULD BE:  16      ACTUAL:  16    RESULT:   OK  

-----------------------------------------------

LOOP IS: FOR I1= 11  TO -7  STEP -3 

CONTROL VARIABLE:
SHOULD BE      ACTUAL         RESULT
 11             11              OK  
 8              8               OK  
 5              5               OK  
 2              2               OK  
-1             -1               OK  
-4             -4               OK  
-7             -7               OK  
LOOP EXITED
-10            -10              OK  

NO. TIMES THROUGH LOOP:
SHOULD BE:  7      ACTUAL:  7    RESULT:   OK  

-----------------------------------------------

LOOP IS: FOR I1= 2  TO  2  STEP  20 

CONTROL VARIABLE:
SHOULD BE      ACTUAL         RESULT
 2              2               OK  
LOOP EXITED
 22             22              OK  

NO. TIMES THROUGH LOOP:
SHOULD BE:  1      ACTUAL:  1    RESULT:   OK  

-----------------------------------------------

LOOP IS: FOR I1= 1.234E+20  TO -4.321E+20  STEP -8.7E+19 

CONTROL VARIABLE:
SHOULD BE      ACTUAL         RESULT
 1.234E+20      1.234E+20       OK  
 3.64E+19       3.64E+19        OK  
-5.06E+19      -5.06E+19        OK  
-1.376E+20     -1.376E+20       OK  
-2.246E+20     -2.246E+20       OK  
-3.116E+20     -3.116E+20       OK  
-3.986E+20     -3.986E+20       OK  
LOOP EXITED
-4.856E+20     -4.856E+20       OK  

NO. TIMES THROUGH LOOP:
SHOULD BE:  7      ACTUAL:  7    RESULT:   OK  

-----------------------------------------------

LOOP IS: FOR I1= 0  TO  0  STEP -2 

CONTROL VARIABLE:
SHOULD BE      ACTUAL         RESULT
 0              0               OK  
LOOP EXITED
-2             -2               OK  

NO. TIMES THROUGH LOOP:
SHOULD BE:  1      ACTUAL:  1    RESULT:   OK  

-----------------------------------------------

*** TEST PASSED ***

               END TEST.

END PROGRAM 44

Program interrupted at line 2090
