Lucas-Lehmer test: Difference between revisions

m
m (→‎{{header|Wren}}: Minor tidy)
Line 4,120:
{{libheader|wren-math}}
This follows the lines of my Kotlin entry but uses a table to quicken up the checking of the larger numbers. Despite this, it still takes just over 3 minutes to reach M4423. Surprisingly, using ''modPow'' rather than the simple ''%'' operator is even slower.
<syntaxhighlight lang="ecmascriptwren">import "./big" for BigInt
import "./math" for Int
import "io" for Stdout
 
Line 4,167:
{{libheader|Wren-gmp}}
Same approach as the CLI version but now uses GMP. Far quicker, of course, as we can now check up to M110503 in less time than before.
<syntaxhighlight lang="ecmascriptwren">import "./gmp" for Mpz
import "./math" for Int
 
9,476

edits