WPILibC++ 2023.4.3-108-ge5452e3
pow.hpp File Reference

Go to the source code of this file.

Namespaces

namespace  internal
 

Functions

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...
 

Function Documentation

◆ 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
basea real-valued input.
exp_terma 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})} \)