Factors of an integer: Difference between revisions
Content added Content deleted
(→{{header|MUMPS}}: Added a Mercury implementation.) |
|||
Line 1,326: | Line 1,326: | ||
This implementation of factoring works as follows: |
This implementation of factoring works as follows: |
||
# The input number itself and 1 are both considered factors. |
|||
# The numbers between 2 and the square root of the input number are checked for even division. |
|||
# If the incremental number divides evenly into the input number, both the incremental number and the quotient are added to the list of factors. |
|||
===fac.m=== |
===fac.m=== |