10.2.6 Count up to Zero

This transformation simplifies the termination test (computers often have separate instructions to test for 0):

     LOOP FOR I := 1 TO N DO         LOOP FOR I := 1 - N TO 0

           ...I...                         ...I + N...

     ENDLOOP                         ENDLOOP

Send questions and comments to: Karen Lemone