43 return exp(exp_term*
log(base));
46template<
typename T1,
typename T2,
typename TC = common_t<T1,T2>,
47 typename std::enable_if<!std::is_
integral<T2>::value>::type* =
nullptr>
53 return( base < T1(0) ? \
56 pow_dbl(
static_cast<TC
>(base),
static_cast<TC
>(exp_term)) );
59template<
typename T1,
typename T2,
typename TC = common_t<T1,T2>,
60 typename std::enable_if<std::is_
integral<T2>::value>::type* =
nullptr>
63pow_check(
const T1 base,
const T2 exp_term)
79template<
typename T1,
typename T2>
82pow(
const T1 base,
const T2 exp_term)
85 if (std::is_constant_evaluated()) {
88 return std::pow(base, exp_term);
82pow(
const T1 base,
const T2 exp_term) {
…}
constexpr T pow_dbl(const T base, const T exp_term) noexcept
Definition pow.hpp:40
constexpr T1 pow_integral(const T1 base, const T2 exp_term) noexcept
Definition pow_integral.hpp:123
constexpr TC pow_check(const T1 base, const T2 exp_term) noexcept
Definition pow.hpp:50
std::numeric_limits< T > GCLIM
Definition gcem_options.hpp:74
constexpr return_t< T > log(const T x) noexcept
Compile-time natural logarithm function.
Definition log.hpp:186
typename std::common_type< T... >::type common_t
Definition gcem_options.hpp:80
constexpr common_t< T1, T2 > pow(const T1 base, const T2 exp_term) noexcept
Compile-time power function.
Definition pow.hpp:82