Proper divisors: Difference between revisions

Content added Content deleted
m (→‎version 2: updated the output section.)
m (→‎version 3: added whitespace.)
Line 4,850: Line 4,850:
<lang rexx>/*REXX program finds proper divisors (and count) of integer ranges; finds the max count.*/
<lang rexx>/*REXX program finds proper divisors (and count) of integer ranges; finds the max count.*/
parse arg bot top inc range xtra /*obtain optional arguments from the CL*/
parse arg bot top inc range xtra /*obtain optional arguments from the CL*/
if bot=='' | bot=="," then bot= 1 /*Not specified? Then use the default.*/
if bot=='' | bot=="," then bot= 1 /*Not specified? Then use the default.*/
if top=='' | top=="," then top= 10 /* " " " " " " */
if top=='' | top=="," then top= 10 /* " " " " " " */
if inc=='' | inc=="," then inc= 1 /* " " " " " " */
if inc=='' | inc=="," then inc= 1 /* " " " " " " */
if range=='' | range=="," then range=20000 /* " " " " " " */
if range=='' | range=="," then range= 20000 /* " " " " " " */
w= max( length(top), length(bot), length(range)) /*determine the biggest number of these*/
w= max( length(top), length(bot), length(range)) /*determine the biggest number of these*/
numeric digits max(9, w + 1) /*have enough digits for // operator.*/
numeric digits max(9, w + 1) /*have enough digits for // operator.*/