Euler's constant 0.5772...: Difference between revisions

Content added Content deleted
(Adds a Nim implementation of Euler's Constant)
m (Move Nim entry to correct location)
Line 792: Line 792:
0.5772156649015341
0.5772156649015341
</pre>
</pre>



=={{header|Julia}}==
=={{header|Julia}}==
Line 798: Line 797:
<lang julia>display(MathConstants.γ) # γ = 0.5772156649015...
<lang julia>display(MathConstants.γ) # γ = 0.5772156649015...
</lang>
</lang>

=={{header|Nim}}==
<lang nim>import std/math

const n = 1e6
var result = 1.0

for i in 2..int(n):
result += 1/i

echo result - ln(n)
</lang>
{{out}}
<pre>
0.5772161649007153
</pre>


=={{header|PARI/GP}}==
=={{header|PARI/GP}}==
Line 1,377: Line 1,392:
<pre>
<pre>
0.5772156649015328606065120900824024310421593359399235988057672348848677267776646709369470632917467495
0.5772156649015328606065120900824024310421593359399235988057672348848677267776646709369470632917467495
</pre>

=={{header|Nim}}==
<lang nim>import std/math

const n = 1e6
var result = 1.0

for i in 2..int(n):
result += 1/i

echo result - ln(n)
</lang>
{{out}}
<pre>
0.5772161649007153
</pre>
</pre>