Meissel–Mertens constant: Difference between revisions
→{{header|Wren}}: A change in the order of operations fixed the apparent bug (thanks to Michel Hermier for spotting this).
(→J: Define verb) |
(→{{header|Wren}}: A change in the order of operations fixed the apparent bug (thanks to Michel Hermier for spotting this).) |
||
Line 278:
{{libheader|Wren-math}}
{{libheader|Wren-fmt}}
It will be seen that this is converging to the correct answer though we'd need to add a lot more primes to obtain a valid 11th digit.
<syntaxhighlight lang="ecmascript">import "./math" for Int
import "./fmt" for Fmt
Line 293 ⟶ 291:
for (p in primes) {
var rp = 1/p
sum =
c = c + 1
if ((c % 1e7) == 0 || c == pc) Fmt.print("$,11d $0.12f", c, sum + euler)
Line 302 ⟶ 300:
Primes added M
------------ --------------
10,000,000 0.
20,000,000 0.
30,000,000 0.
40,000,000 0.
50,000,000 0.
60,000,000 0.
70,000,000 0.
80,000,000 0.
90,000,000 0.
100,000,000 0.
105,097,565 0.
</pre>
|