Generator/Exponential: Difference between revisions
Content deleted Content added
→{{header|REXX}}: added the REXX language. -- ~~~~ |
m →{{header|REXX}}: added more comments to the REXX code. -- ~~~~ |
||
Line 1,316:
=={{header|REXX}}==
Code was added to support listing of so many values, the default is 0 (zero).
<br>The generators lie dormant until a request is made (illustrated by the calling of "TELL" to display some values).
<br>A lot of unnecessary iterator calls could be eliminated (and making the program a lot faster) if a check would be made to determine if a value has been emitted.
<br>The REXX program can handle any numbers, not just positive integers; one only need to increase the size of the DIGITS if more are needed.
<lang rexx>
/*REXX program to show how to use a generator (also known as iterators).*/
numeric digits
gen_.= /*have generators from scratch. */
/*how_many: show that many vals.*/
|