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▼
nested done
[] swap
dup times
[
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>
{{out}}
|