3#ifndef TETL_CMATH_TRUNC_HPP
4#define TETL_CMATH_TRUNC_HPP
8#include <etl/_3rd_party/gcem/gcem.hpp>
17[[nodiscard]]
constexpr auto trunc(T
arg)
noexcept -> T
21#if __has_builtin(__builtin_truncf)
22 return __builtin_truncf(
arg);
26#if __has_builtin(__builtin_trunc)
27 return __builtin_trunc(
arg);
32 return detail::gcem::trunc(
arg);
42[[nodiscard]]
constexpr auto trunc(
float arg)
noexcept ->
float {
return detail::trunc(
arg); }
43[[nodiscard]]
constexpr auto truncf(
float arg)
noexcept ->
float {
return detail::trunc(
arg); }
44[[nodiscard]]
constexpr auto trunc(
double arg)
noexcept ->
double {
return detail::trunc(
arg); }
45[[nodiscard]]
constexpr auto trunc(
long double arg)
noexcept ->
long double {
return detail::trunc(
arg); }
46[[nodiscard]]
constexpr auto truncl(
long double arg)
noexcept ->
long double {
return detail::trunc(
arg); }
47[[nodiscard]]
constexpr auto trunc(
integral auto arg)
noexcept ->
double {
return detail::trunc(
double(
arg)); }
The concept integral<T> is satisfied if and only if T is an integral type.
Definition integral.hpp:13
constexpr auto trunc(float arg) noexcept -> float
Computes the nearest integer not greater in magnitude than arg.
Definition trunc.hpp:42
constexpr auto truncf(float arg) noexcept -> float
Computes the nearest integer not greater in magnitude than arg.
Definition trunc.hpp:43
constexpr auto truncl(long double arg) noexcept -> long double
Computes the nearest integer not greater in magnitude than arg.
Definition trunc.hpp:46
constexpr auto arg(complex< T > const &z) noexcept -> T
Definition arg.hpp:15
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
constexpr bool is_same_v
Definition is_same.hpp:11