4#ifndef TETL_CMATH_COS_HPP
5#define TETL_CMATH_COS_HPP
7#include <etl/_config/all.hpp>
9#include <etl/_3rd_party/gcem/gcem.hpp>
10#include <etl/_concepts/integral.hpp>
11#include <etl/_concepts/same_as.hpp>
12#include <etl/_type_traits/is_constant_evaluated.hpp>
18inline constexpr struct cos {
19 template <
typename Float>
20 [[nodiscard]]
constexpr auto operator()(Float arg)
const noexcept -> Float
23#if __has_builtin(__builtin_cosf)
24 if constexpr (
etl::same_as<Float,
float>) {
25 return __builtin_cosf(arg);
28#if __has_builtin(__builtin_cos)
29 if constexpr (
etl::same_as<Float,
double>) {
30 return __builtin_cos(arg);
34 return etl::detail::gcem::cos(arg);
47 return etl::detail::cos(arg);
51 return etl::detail::cos(arg);
55 return etl::detail::cos(arg);
57[[
nodiscard]]
constexpr auto cos(
long double arg)
noexcept ->
long double
59 return etl::detail::cos(arg);
61[[
nodiscard]]
constexpr auto cosl(
long double arg)
noexcept ->
long double
63 return etl::detail::cos(arg);
constexpr auto cos(float arg) noexcept -> float
Definition cos.hpp:45
constexpr auto cosl(long double arg) noexcept -> long double
Definition cos.hpp:61
constexpr auto cosf(float arg) noexcept -> float
Definition cos.hpp:49
constexpr auto cos(double arg) noexcept -> double
Definition cos.hpp:53
constexpr auto cos(long double arg) noexcept -> long double
Definition cos.hpp:57
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