Anonymous user
Factors of an integer: Difference between revisions
→{{header|Ursala}}
Line 700:
=={{header|Ursala}}==
The simple way:
<lang Ursala>#import std
#import nat
factors "n" = (filter not remainder/"n") nrange(1,"n")</lang>
The complicated way:
<lang Ursala>factors "n" = nleq-<&@s <.~&r,quotient>*= "n"-* (not remainder/"n")*~ nrange(1,root("n",2))</lang>
test program:
<lang Ursala>#cast %nL
|