Digital root: Difference between revisions

m
→‎{{header|REXX}}: added "additive" to the first title line.
m (→‎{{header|REXX}}: changed parsing to be faster, addec/changed whitespace and comments, moved the displaying of the digital root and persistence out of the function.)
m (→‎{{header|REXX}}: added "additive" to the first title line.)
Line 4,021:
===version 2===
<lang rexx>/*REXX program calculates and displays the digital root and additive persistence. */
say 'digital' additive' /*display the 1st line of the header.*/
say " root persistence" center('number',77) /* " " 2nd " " " " */
say "═══════ ═══════════" left('', 77, "═") /* " " 3rd " " " " */
Line 4,041:
{{out|output|text=&nbsp; when using the internal default inputs:}}
<pre>
digital additive
root persistence number
═══════ ═══════════ ═════════════════════════════════════════════════════════════════════════════
Line 4,055:
This subroutine version can also handle numbers with signs, &nbsp; blanks, &nbsp; commas, &nbsp; and/or decimal points.
<lang rexx>/*REXX program calculates and displays the digital root and additive persistence. */
say 'digital' additive' /*display the 1st line of the header.*/
say " root persistence" center('number',77) /* " " 2nd " " " " */
say "═══════ ═══════════" left('', 77, "═") /* " " 3rd " " " " */