Anonymous user
Factors of an integer: Difference between revisions
→fac.m
(→fac.m) |
(→fac.m) |
||
Line 1,329:
list.sort_and_remove_dups([1, N | Unsorted], Factors).
:- pred factor(int
:- mode factor(in, in, in, in, out) is det.
factor(N, X, Limit, !Accumulator) :-
( if X > Limit
Line 1,342 ⟶ 1,343:
factor(N) = Factors :- factor(N, Factors).
:- end_module fac.</lang>
===Use and output===
|