Jump to content

Primality by trial division: Difference between revisions

m (→‎{{header|Wren}}: Minor tidy)
Line 3,029:
=== Recursive ===
{{trans|Go}}
{{works with|langur|0.11}}
<syntaxhighlight lang="langur">val .isPrime = f(.i) {
val .n = abs(.i)
Line 3,052 ⟶ 3,051:
Below, we use an implied parameter (.i) on the .isPrime function.
 
{{works with|langur|0.11}}
<syntaxhighlight lang="langur">val .isPrime = f .i == 2 or
.i > 2 and not any f(.x) .i div .x, pseries 2 .. .i ^/ 2
990

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.