Go to the source code of this file.
|
template<typename T > |
constexpr T | internal::pow_dbl (const T base, const T exp_term) noexcept |
|
template<typename T1 , typename T2 , typename TC = common_t<T1,T2>, typename std::enable_if<!std::is_integral< T2 >::value >::type * = nullptr> |
constexpr TC | internal::pow_check (const T1 base, const T2 exp_term) noexcept |
|
template<typename T1 , typename T2 > |
constexpr common_t< T1, T2 > | pow (const T1 base, const T2 exp_term) noexcept |
| Compile-time power function. More...
|
|
◆ pow()
template<typename T1 , typename T2 >
constexpr common_t< T1, T2 > pow |
( |
const T1 |
base, |
|
|
const T2 |
exp_term |
|
) |
| |
|
constexprnoexcept |
Compile-time power function.
- Parameters
-
base | a real-valued input. |
exp_term | a real-valued input. |
- Returns
- Computes
base
raised to the power exp_term
. In the case where exp_term
is integral-valued, recursion by squaring is used, otherwise \( \text{base}^{\text{exp\_term}} = e^{\text{exp\_term} \log(\text{base})} \)