Home primes: Difference between revisions

Content added Content deleted
(Added Python implementation for the Home Primes task)
m (→‎{{header|Wren}}: Minor tidy)
Line 1,281: Line 1,281:


Reaches HP20 in about 0.52 seconds but HP65 took just under 40 minutes!
Reaches HP20 in about 0.52 seconds but HP65 took just under 40 minutes!
<syntaxhighlight lang="ecmascript">import "/math" for Int
<syntaxhighlight lang="wren">import "./math" for Int
import "/big" for BigInt
import "./big" for BigInt
var list = (2..20).toList
var list = (2..20).toList
Line 1,336: Line 1,336:
{{libheader|Wren-gmp}}
{{libheader|Wren-gmp}}
This reduces the overall time taken to 5.1 seconds. The factorization method used is essentially the same as the Wren-cli version so the vast improvement in performance is due solely to the use of GMP.
This reduces the overall time taken to 5.1 seconds. The factorization method used is essentially the same as the Wren-cli version so the vast improvement in performance is due solely to the use of GMP.
<syntaxhighlight lang="ecmascript">/* home_primes_gmp.wren */
<syntaxhighlight lang="wren">/* Home_primes_2.wren */


import "./gmp" for Mpz
import "./gmp" for Mpz