Go to the source code of this file.
|
template<typename T > |
constexpr T | internal::binomial_coef_recur (const T n, const T k) noexcept |
|
template<typename T , typename std::enable_if< std::is_integral< T >::value >::type * = nullptr> |
constexpr T | internal::binomial_coef_check (const T n, const T k) noexcept |
|
template<typename T1 , typename T2 , typename TC = common_t<T1,T2>> |
constexpr TC | internal::binomial_coef_type_check (const T1 n, const T2 k) noexcept |
|
template<typename T1 , typename T2 > |
constexpr common_t< T1, T2 > | binomial_coef (const T1 n, const T2 k) noexcept |
| Compile-time binomial coefficient. More...
|
|
◆ binomial_coef()
template<typename T1 , typename T2 >
constexpr common_t< T1, T2 > binomial_coef |
( |
const T1 |
n, |
|
|
const T2 |
k |
|
) |
| |
|
constexprnoexcept |
Compile-time binomial coefficient.
- Parameters
-
n | integral-valued input. |
k | integral-valued input. |
- Returns
- computes the Binomial coefficient
\[ \binom{n}{k} = \frac{n!}{k!(n-k)!} \]
also known as 'n
choose k
'.