Wagstaff primes: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
(Added Quackery.)
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
(2 intermediate revisions by 2 users not shown)
Line 347:
using big_int = mpz_class;
 
std::string to_string(const big_int& num, size_t nmax_digits) {
std::string str = num.get_str();
size_t len = str.size();
if (len > nmax_digits) {
str = str.substrreplace(0, nmax_digits / 2), +len - max_digits, "..." + str.substr(len - n / 2);
str += " (";
str += std::to_string(len);
Line 1,189:
=={{header|Quackery}}==
 
<code>from</code>, <code>index</code>, <code>incr</code>, and <code>end</code> are defined at [[Loops/Increment loop index within loop body#Quackery]].
 
<code>prime</code> is defined at [[Miller–Rabin primality test#Quackery]].
Line 1,358:
 
Even so, as far as the stretch goal is concerned, takes around 25 seconds to find the next 14 Wagstaff primes but almost 10 minutes to find the next 19 on my machine (Core i7). I gave up after that.
<syntaxhighlight lang="ecmascriptwren">import "./math" for Int
import "./gmp" for Mpz
import "./fmt" for Fmt
9,476

edits