Quasar
  • Member for 3 years, 8 months
  • Last seen more than a month ago
Calculator of combinations without repetition
5 votes

One trick is to keep the partial products in small, \${n}\choose{k}\$ so they don't overflow. I iteratively multiply \$n/(n-k)\$ by \$(n-1)/(n-k-1)\$, cache the result in an accumulator, multiply ...

View answer