Jump to content

Hickerson series of almost integers: Difference between revisions

→‎{{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.01.64
 
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)
Cookies help us deliver our services. By using our services, you agree to our use of cookies.