Anonymous user
Hickerson series of almost integers: Difference between revisions
Hickerson series of almost integers (view source)
Revision as of 17:50, 26 August 2017
, 6 years ago→{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details
m (→{{header|Sidef}}: updated code) |
(→{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details) |
||
Line 1,053:
=={{header|Kotlin}}==
{{trans|Java}}
<lang scala>// version 1.
import java.math.BigDecimal
Line 1,065:
val a = BigDecimal(LN2).pow(n + 1) * BigDecimal(2)
var nn = n
var f = n.toLong()
while (--nn > 1) f *= nn
val b = BigDecimal(f).divide(a, MathContext.DECIMAL128)
|