34 #ifndef NUMCPP_NO_USE_BOOST
35 #include "boost/math/special_functions/factorials.hpp"
61 double combinations = 1.;
63 #ifndef NUMCPP_NO_USE_BOOST
64 if (n <= boost::math::max_factorial<double>::value)
67 const double nMinusRFactoral =
factorial(n - r);
69 combinations = nFactorial / nMinusRFactoral;
74 const uint32 lower = n - r + 1;
75 combinations =
static_cast<double>(lower);
76 for (
uint32 i = lower + 1; i <= n; ++i)
78 combinations *=
static_cast<double>(i);
80 #ifndef NUMCPP_NO_USE_BOOST
double factorial(uint32 inValue)
Definition: factorial.hpp:51
double pnr(uint32 n, uint32 r)
Definition: pnr.hpp:50
Definition: Coordinate.hpp:45
std::uint32_t uint32
Definition: Types.hpp:40