Jump to content

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 timesmultiplication) was a strict requirement or
<br>whether there're blanks surrounding the &nbsp; '''x''' &nbsp; (blanks were assumed for this example for readability).
<br>There's commented code that shows how to not include blanks around the &nbsp; '''x''' &nbsp; [see comment about '''BLANKS=0''' &nbsp; &nbsp; (6th statement)].
<br><br>Also, as per the task's requirements, the prime factors of &nbsp; '''1''' &nbsp; (unity) will be listed as &nbsp; '''1''',
<br>even though, strictly speaking, it should be &nbsp; '''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' /*character used for "times" (x).*/
list= /*nullify the list (to empty). */
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.