Jump to content

Evaluate binomial coefficients: Difference between revisions

Line 1,039:
<lang scala>object Binomial extends App {
def binomialCoefficient(n: Int, k: Int) =
(BigInt(n - k + 1) to BigInt(n)).product /
(BigInt(1) to BigInt(k)).product
 
val Array(n, k) = args.map(_.toInt)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.