35 #include "boost/math/special_functions/factorials.hpp"
62 double combinations = 1.0;
65 if (n <= boost::math::max_factorial<double>::value)
68 const double nMinusRFactoral =
factorial(n - r);
70 combinations = nFactorial / nMinusRFactoral;
75 const uint32 lower = n - r + 1;
76 combinations =
static_cast<double>(lower);
77 for (
uint32 i = lower + 1; i <= n; ++i)
79 combinations *=
static_cast<double>(i);