Loops/While: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: changed verb tense. -- ~~~~) |
m (→{{header|REXX}}: expanded and aligned the initial REXX program comment(s). -- ~~~) |
||
Line 1,083: | Line 1,083: | ||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
===simple version=== |
===simple version=== |
||
<lang rexx>/*REXX program demonstrates a |
<lang rexx>/*REXX program demonstrates a DO WHILE with index reduction construct.*/ |
||
j=1024 /*define the initial value of J.*/ |
j=1024 /*define the initial value of J.*/ |
||
do while j>0 /*test if made at the top of DO.*/ |
do while j>0 /*test if made at the top of DO.*/ |
||
Line 1,110: | Line 1,110: | ||
::::: '''DO WHILE x\==0''' |
::::: '''DO WHILE x\==0''' |
||
but that wouldn't be compliant with the wording of the task. |
but that wouldn't be compliant with the wording of the task. |
||
<lang rexx>/*REXX program demonstrates a |
<lang rexx>/*REXX program demonstrates a DO WHILE with index reduction construct.*/ |
||
x=1024 /*define the initial value of X.*/ |
x=1024 /*define the initial value of X.*/ |
||
do while x>0 /*test if made at the top of DO.*/ |
do while x>0 /*test if made at the top of DO.*/ |
||
Line 1,133: | Line 1,133: | ||
===version 3, faster WHILE comparison=== |
===version 3, faster WHILE comparison=== |
||
<lang rexx>/*REXX program demonstrates a |
<lang rexx>/*REXX program demonstrates a DO WHILE with index reduction construct.*/ |
||
x=1024 /*define the initial value of X.*/ |
x=1024 /*define the initial value of X.*/ |
||
do while x>>0 /*this is an exact comparison. */ |
do while x>>0 /*this is an exact comparison. */ |