Narcissistic decimal number: Difference between revisions

Content added Content deleted
m (→‎optimized: changed the wording in the REXX section header comments.)
m (→‎optimized, unrolled: changed the wording/highlighting in the REXX section header comment.)
Line 1,993: Line 1,993:


===optimized, unrolled===
===optimized, unrolled===
This REXX version is further optimized by unrolling part of the DO loop that sums the digits.
This REXX version is further optimized by unrolling part of the   '''do'''   loop that sums the digits.

<br>The unrolling also necessitated the special handling of one- and two-digit narcissistic numbers.
The unrolling also necessitated the special handling of one- and two-digit narcissistic numbers.
<lang rexx>/*REXX pgm generates and displays a number of narcissistic (Armstrong) numbers*/
<lang rexx>/*REXX pgm generates and displays a number of narcissistic (Armstrong) numbers*/
numeric digits 39 /*be able to handle largest Armstrong #*/
numeric digits 39 /*be able to handle largest Armstrong #*/