4#ifndef TETL_CMATH_ROUND_HPP
5#define TETL_CMATH_ROUND_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>
12#include <etl/_type_traits/is_same.hpp>
19[[nodiscard]]
constexpr auto round(T arg)
noexcept -> T
22 if constexpr (is_same_v<T,
float>) {
23#if __has_builtin(__builtin_roundf)
24 return __builtin_roundf(arg);
27 if constexpr (is_same_v<T,
double>) {
28#if __has_builtin(__builtin_round)
29 return __builtin_round(arg);
33 return detail::gcem::round(arg);
48 return etl::detail::round(arg);
52 return etl::detail::round(arg);
56 return etl::detail::round(arg);
60 return etl::detail::round(arg);
64 return etl::detail::round(arg);
constexpr auto roundf(float arg) noexcept -> float
Definition round.hpp:50
constexpr auto round(long double arg) noexcept -> long double
Definition round.hpp:58
constexpr auto round(float arg) noexcept -> float
Definition round.hpp:46
constexpr auto round(double arg) noexcept -> double
Definition round.hpp:54
constexpr auto roundl(long double arg) noexcept -> long double
Definition round.hpp:62
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