Anonymous user
Count in factors: Difference between revisions
m
→{{header|REXX}}: added highlights and whitespace in the REXX section header. -- ~~~~
m (→{{header|REXX}}: added highlights and whitespace in the REXX section header. -- ~~~~) |
|||
Line 1,473:
=={{header|REXX}}==
It couldn't be determined if the '''x''' (for
<br>whether there're blanks surrounding the '''x''' (blanks were assumed for this example for readability).
<br>There's commented code that shows how to not include blanks around the '''x''' [see comment about '''BLANKS=0''' (6th statement)].
<br><br>Also, as per the task's requirements, the prime factors of '''1''' (unity) will be listed as '''1''',
<br>even though, strictly speaking, it should be '''null'''.
<lang rexx>/*REXX program to find & list the prime factors of positive integer(s). */
numeric digits 100 /*bump precision of the numbers. */
Line 1,492:
if x <1 then return '' /*invalid number? Return null. */
if x==1 then return 1 /*special case for unity. */
Xtimes= 'x'
list= /*nullify the list (to empty). */
|