Meissel–Mertens constant: Difference between revisions

Content added Content deleted
(Added Perl)
Line 396: Line 396:
? ##
? ##
*** last result: cpu time 283 ms, real time 284 ms.</pre>
*** last result: cpu time 283 ms, real time 284 ms.</pre>

=={{header|Perl}}==
{{libheader|ntheory}}
<syntaxhighlight lang="perl" line>use v5.36;
use ntheory 'is_prime';

my $s;
is_prime $_ and $s += log(1 - 1/$_)+1/$_ for 2 .. 10**9;
say my $result = $s + .57721566490153286;</syntaxhighlight>
{{out}}
<pre>0.261497212871049</pre>


=={{header|Phix}}==
=={{header|Phix}}==