3#ifndef TETL_CMATH_POW_HPP
4#define TETL_CMATH_POW_HPP
8#include <etl/_3rd_party/gcem/gcem.hpp>
16[[nodiscard]]
constexpr auto pow(
float base,
float exp) ->
float
19#if __has_constexpr_builtin(__builtin_powf)
20 return __builtin_powf(base,
exp);
22 return etl::detail::gcem::pow(base,
exp);
25#if __has_builtin(__builtin_powf)
26 return __builtin_powf(base,
exp);
28 return etl::detail::gcem::pow(base,
exp);
40[[nodiscard]]
constexpr auto pow(
double base,
double exp) ->
double
43#if __has_constexpr_builtin(__builtin_pow)
44 return __builtin_pow(base,
exp);
46 return etl::detail::gcem::pow(base,
exp);
49#if __has_builtin(__builtin_pow)
50 return __builtin_pow(base,
exp);
52 return etl::detail::gcem::pow(base,
exp);
59[[nodiscard]]
constexpr auto pow(
long double base,
long double exp) ->
long double
61 return detail::gcem::pow(base,
exp);
67[[nodiscard]]
constexpr auto powl(
long double base,
long double exp) ->
long double {
return etl::pow(base,
exp); }
72[[nodiscard]]
constexpr auto pow(
float base,
int iexp) ->
float {
return etl::pow(base,
static_cast<float>(iexp)); }
77[[nodiscard]]
constexpr auto pow(
double base,
int iexp) ->
double {
return etl::pow(base,
static_cast<double>(iexp)); }
82[[nodiscard]]
constexpr auto pow(
long double base,
int iexp) ->
long double
84 return etl::pow(base,
static_cast<long double>(iexp));
constexpr auto powl(long double base, long double exp) -> long double
Computes the value of base raised to the power exp.
Definition pow.hpp:67
constexpr auto pow(float base, float exp) -> float
Computes the value of base raised to the power exp.
Definition pow.hpp:16
constexpr auto powf(float base, float exp) -> float
Computes the value of base raised to the power exp.
Definition pow.hpp:35
constexpr auto exp(float arg) noexcept -> float
Computes e (Euler's number, 2.7182...) raised to the given power arg.
Definition exp.hpp:44
Definition adjacent_find.hpp:8
constexpr auto is_constant_evaluated() noexcept -> bool
Detects whether the function call occurs within a constant-evaluated context. Returns true if the eva...
Definition is_constant_evaluated.hpp:16