Data update
This commit is contained in:
parent
ed705008a8
commit
0df55f9f24
2196 changed files with 32999 additions and 3075 deletions
|
|
@ -0,0 +1,16 @@
|
|||
/**
|
||||
* Using a simple formula derived from Hurwitz zeta function,
|
||||
* as described on https://en.wikipedia.org/wiki/Euler%27s_constant,
|
||||
* gives a result accurate to 11 decimal places: 0.57721566490...
|
||||
*/
|
||||
|
||||
object EulerConstant extends App {
|
||||
|
||||
println(gamma(1_000_000))
|
||||
|
||||
private def gamma(N: Int): Double = {
|
||||
val sumOverN = (1 to N).map(1.0 / _).sum
|
||||
sumOverN - Math.log(N) - 1.0 / (2 * N)
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue