34#ifndef NUMCPP_NO_USE_BOOST
35#include "boost/math/special_functions/factorials.hpp"
59 double combinations = 1.;
61#ifndef NUMCPP_NO_USE_BOOST
62 if (n <= boost::math::max_factorial<double>::value)
65 const double nMinusRFactoral =
factorial(n - r);
67 combinations = nFactorial / nMinusRFactoral;
72 const uint32 lower = n - r + 1;
73 combinations =
static_cast<double>(lower);
74 for (
uint32 i = lower + 1; i <= n; ++i)
76 combinations *=
static_cast<double>(i);
78#ifndef NUMCPP_NO_USE_BOOST
Definition: airy_ai.hpp:39
double factorial(uint32 inValue)
Definition: factorial.hpp:49
double pnr(uint32 n, uint32 r)
Definition: pnr.hpp:48
std::uint32_t uint32
Definition: Types.hpp:40