34 #ifndef NUMCPP_NO_USE_BOOST
35 #include "boost/math/special_functions/factorials.hpp"
62 double combinations = 1.0;
64 #ifndef NUMCPP_NO_USE_BOOST
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);
81 #ifndef NUMCPP_NO_USE_BOOST
double factorial(uint32 inValue)
Definition: factorial.hpp:53
double pnr(uint32 n, uint32 r)
Definition: pnr.hpp:51
Definition: Coordinate.hpp:45
std::uint32_t uint32
Definition: Types.hpp:40