Prime decomposition: Difference between revisions

→‎{{header|Quackery}}: added tests for primality
(→‎{{header|Quackery}}: added tests for primality)
Line 4,840:
=={{header|Quackery}}==
 
<code>prime</code> is defined at [[Miller-Rabin primality test#Quackery]].
<syntaxhighlight lang="quackery"> [ [] swap
 
<syntaxhighlight lang="quackery"> [ []dup prime iff swap
nested done
[] swap
dup times
[ [ dup i^ 2 + /modprime
not if done
[ dup i^ 2 + /mod
0 = while
nip dip
Line 4,849 ⟶ 4,855:
drop
dup 1 = if conclude ]
drop ] is primefactors ( n --> [ )</syntaxhighlight>
 
1047552 primefactors echo</syntaxhighlight>
 
{{out}}
1,484

edits