Sequence of primorial primes: Difference between revisions
m
→{{header|Phix}}: simplify slightly
m (Minor edit to C++ code) |
m (→{{header|Phix}}: simplify slightly) |
||
Line 2,589:
=={{header|Phix}}==
{{libheader|Phix/mpfr}}
<lang Phix>include
constant limit = 9999
mpz {p,p1} = mpz_inits(2,1)
atom t0 = time()
integer found = 0, i
Line 2,604 ⟶ 2,598:
for i=-1 to +1 do
mpz_add_si(p1, p, i)
if
integer l = mpz_sizeinbase(p,10)
string ps = iff(l>20?sprintf("%d digits",l)
Line 2,615 ⟶ 2,609:
if found>=20 then exit end if
end for
{p,p1} = mpz_free({p,p1})</lang>
{{out}}
<pre>
|