Anonymous user
Factors of an integer: Difference between revisions
m
→{{header|REXX}}: changed a comment.
m (→{{header|REXX}}: changed a word in the REXX section header.) |
m (→{{header|REXX}}: changed a comment.) |
||
Line 5,085:
odd= x // 2 /* [↓] process EVEN or ODD ints. ___*/
do j=2+odd by 1+odd while j*j<x /*divide by all the integers up to √ x */
if x//j==0 then do; a=a j; b=x%j b; end /*÷? Add
end /*j*/ /* [↑] % ≡ integer division. ___*/
if j*j==x then return a j b /*Was X a square? Then insert √ x */
|