WPILibC++ 2023.4.3-108-ge5452e3
|
Go to the source code of this file.
Namespaces | |
namespace | internal |
Functions | |
template<typename T > | |
constexpr T | internal::factorial_table (const T x) noexcept |
template<typename T , typename std::enable_if< std::is_integral< T >::value >::type * = nullptr> | |
constexpr T | internal::factorial_recur (const T x) noexcept |
template<typename T > | |
constexpr T | factorial (const T x) noexcept |
Compile-time factorial function. More... | |
|
constexprnoexcept |
Compile-time factorial function.
x | a real-valued input. |
x
is an integral type (int
, long int
, etc.), a simple recursion method is used, along with table values. When x
is real-valued, factorial(x) = tgamma(x+1)
.