Circular primes: Difference between revisions

m
→‎Embedded: Minor tidy
m (→‎Embedded: Minor tidy)
 
(2 intermediate revisions by 2 users not shown)
Line 2,771:
DO
<span style="color:blue">NEXT1379</span>
'''IF''' DUP <span style="color:blue">CIRC?</span> '''THEN'''
SWAP OVER + SWAP
'''IF''' OVER SIZE 19 ≥ '''THEN''' 2 SF '''END'''
Line 3,127:
===Wren-cli===
Second part is very slow - over 37 minutes to find all four.
<syntaxhighlight lang="ecmascriptwren">import "./math" for Int
import "./big" for BigInt
import "./str" for Str
var circs = []
Line 3,204:
</pre>
<br>
 
===Embedded===
{{libheader|Wren-gmp}}
A massive speed-up, of course, when GMP is plugged in for the 'probably prime' calculations. 11 minutes 19 seconds including the stretch goal.
<syntaxhighlight lang="ecmascriptwren">/* circular_primes_embeddedCircular_primes_embedded.wren */
import "./gmp" for Mpz
Line 3,300 ⟶ 3,301:
R(49081) : true
</pre>
 
=={{header|XPL0}}==
<syntaxhighlight lang="xpl0">func IsPrime(N); \Return 'true' if N > 2 is a prime number
9,476

edits