Other math functions¶
factorial
function¶
constexpr uint64_t factorial(int n)
Returns the factorial of an argument. Returns max(uint64_t) if does not fit to uint64_t
Source code
constexpr uint64_t factorial(int n)
{
if (n < 0 || n > 20)
return std::numeric_limits<uint64_t>::max();
return factorial_table[n];
}
https://github.com/kfrlib/kfr/blob//include/kfr/math/gamma.hpp#L88
factorial_approx
function¶
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>)>
flt_type<T1> factorial_approx(const T1 &x)
Returns the approximate factorial of an argument
Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>)>
KFR_FUNCTION flt_type<T1> factorial_approx(const T1& x)
{
return intrinsics::factorial_approx(x);
}
https://github.com/kfrlib/kfr/blob//include/kfr/math/gamma.hpp#L51
template <typename E1,
KFR_ENABLE_IF(is_input_expression<E1>)>
internal::expression_function<fn::factorial_approx, E1>
factorial_approx(E1 &&x)
Creates expression that returns the approximate factorial of an argument
Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>)>
KFR_FUNCTION internal::expression_function<fn::factorial_approx, E1> factorial_approx(E1&& x)
{
return { fn::factorial_approx(), std::forward<E1>(x) };
}
https://github.com/kfrlib/kfr/blob//include/kfr/math/gamma.hpp#L58
gamma
function¶
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>)>
flt_type<T1> gamma(const T1 &x)
Returns the approximate gamma function of an argument
Source code
template <typename T1, KFR_ENABLE_IF(is_numeric<T1>)>
KFR_FUNCTION flt_type<T1> gamma(const T1& x)
{
return intrinsics::gamma(x);
}
https://github.com/kfrlib/kfr/blob//include/kfr/math/gamma.hpp#L37
template <typename E1,
KFR_ENABLE_IF(is_input_expression<E1>)>
internal::expression_function<fn::gamma, E1> gamma(E1 &&x)
Creates expression that returns the approximate gamma function of an argument
Source code
template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>)>
KFR_FUNCTION internal::expression_function<fn::gamma, E1> gamma(E1&& x)
{
return { fn::gamma(), std::forward<E1>(x) };
}
https://github.com/kfrlib/kfr/blob//include/kfr/math/gamma.hpp#L44
Auto-generated from sources, Revision , https://github.com/kfrlib/kfr/blob//include/kfr/