Primality by trial division: Difference between revisions
Content added Content deleted
(→OCaml: simplified & faster) |
(→OCaml: exclude negative numbers) |
||
Line 2,903: | Line 2,903: | ||
in |
in |
||
if n < 5 |
if n < 5 |
||
then n |
then n lor 1 = 3 |
||
else n land 1 <> 0 && n mod 3 <> 0 && test 5</syntaxhighlight> |
else n land 1 <> 0 && n mod 3 <> 0 && test 5</syntaxhighlight> |
||