Proper divisors: Difference between revisions
Content deleted Content added
m →{{header|REXX}}: added/changed comments and whitespace, used a template for the OUTPUTs, simplified the code, used better idiomatic code for handling C.L. input, cre-worked the integer square root code. |
m →version 3: updated the parameter parsing for the Pdivs function. |
||
Line 3,402:
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
Pdivs: procedure; parse arg x 1 z,b; x=abs(x); if x==1 then return ''
odd=x // 2; if x==0 then return '∞'
r=0 /* [↓] ══integer square root══ ___ */
q=1; do while q<=z; q=q*4; end /*R: an integer which will be √ X */
|