4#ifndef TETL_CMATH_LOG_HPP
5#define TETL_CMATH_LOG_HPP
7#include <etl/_config/all.hpp>
9#include <etl/_3rd_party/gcem/gcem.hpp>
10#include <etl/_concepts/integral.hpp>
11#include <etl/_type_traits/is_constant_evaluated.hpp>
17inline constexpr struct log {
18 template <
typename Float>
19 [[nodiscard]]
constexpr auto operator()(Float v)
const noexcept -> Float
22#if __has_builtin(__builtin_logf)
23 if constexpr (is_same_v<Float,
float>) {
24 return __builtin_logf(v);
27#if __has_builtin(__builtin_log)
28 if constexpr (is_same_v<Float,
double>) {
29 return __builtin_log(v);
34 return etl::detail::gcem::log(v);
47 return etl::detail::log(v);
51 return etl::detail::log(v);
55 return etl::detail::log(v);
57[[
nodiscard]]
constexpr auto log(
long double v)
noexcept ->
long double
59 return etl::detail::log(v);
63 return etl::detail::log(v);
constexpr auto logf(float v) noexcept -> float
Definition log.hpp:49
constexpr auto log(float v) noexcept -> float
Definition log.hpp:45
constexpr auto log(double v) noexcept -> double
Definition log.hpp:53
constexpr auto log(long double v) noexcept -> long double
Definition log.hpp:57
constexpr auto logl(long double v) noexcept -> long double
Definition log.hpp:61
Definition adjacent_find.hpp:9
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:17