Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Jensens-Device/REXX/jensens-device.rexx
Normal file
17
Task/Jensens-Device/REXX/jensens-device.rexx
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/*REXX program demonstrates Jensen's device (via call subroutine, and args by name). */
|
||||
parse arg d . /*obtain optional argument from the CL.*/
|
||||
if d=='' | d=="," then d= 100 /*Not specified? Then use the default.*/
|
||||
numeric digits d /*use D decimal digits (9 is default)*/
|
||||
say 'using ' d " decimal digits:" /*display what's being used for digits.*/
|
||||
say
|
||||
say sum( i, 1, 100, "1/i" ) /*invoke SUM (100th harmonic number).*/
|
||||
exit /*stick a fork in it, we're all done. */
|
||||
/*──────────────────────────────────────────────────────────────────────────────────────*/
|
||||
sum: procedure; parse arg j,start,finish,exp; $= 0
|
||||
|
||||
interpret 'do' j "=" start 'to' finish "; $=$+" exp '; end'
|
||||
|
||||
/*comment ──── ═ ─── ═════ ──── ══════ ────────── ═══ ───────── */
|
||||
/*comment lit var lit var lit var literal var literal */
|
||||
|
||||
return $
|
||||
Loading…
Add table
Add a link
Reference in a new issue