Perfect numbers: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: changed a comment to not use abbreviation for digital.) |
m (→optimized using digital root: added whitespace.) |
||
Line 1,498: | Line 1,498: | ||
w=length(high) /*use W for formatting output. */ |
w=length(high) /*use W for formatting output. */ |
||
numeric digits max(9,w+2) /*ensure enough digits to handle#*/ |
numeric digits max(9,w+2) /*ensure enough digits to handle#*/ |
||
do i=low to high /*process the single # or range. */ |
do i=low to high /*process the single # or range. */ |
||
if isPerfect(i) then say right(i,w) 'is a perfect number.' |
if isPerfect(i) then say right(i,w) 'is a perfect number.' |