4#ifndef TETL_CMATH_FMOD_HPP
5#define TETL_CMATH_FMOD_HPP
7#include <etl/_3rd_party/gcem/gcem.hpp>
8#include <etl/_type_traits/is_constant_evaluated.hpp>
14inline constexpr struct fmod {
15 template <
typename Float>
16 [[nodiscard]]
constexpr auto operator()(Float x, Float y)
const noexcept -> Float
19#if __has_builtin(__builtin_fmodf)
20 if constexpr (etl::same_as<Float,
float>) {
21 return __builtin_fmodf(x, y);
24#if __has_builtin(__builtin_fmod)
25 if constexpr (etl::same_as<Float,
double>) {
26 return __builtin_fmod(x, y);
30 return etl::detail::gcem::fmod(x, y);
43 return etl::detail::fmod(x, y);
47 return etl::detail::fmod(x, y);
51 return etl::detail::fmod(x, y);
53[[
nodiscard]]
constexpr auto fmod(
long double x,
long double y)
noexcept ->
long double
55 return etl::detail::fmod(x, y);
57[[
nodiscard]]
constexpr auto fmodl(
long double x,
long double y)
noexcept ->
long double
59 return etl::detail::fmod(x, y);
constexpr auto fmod(long double x, long double y) noexcept -> long double
Definition fmod.hpp:53
constexpr auto fmodl(long double x, long double y) noexcept -> long double
Definition fmod.hpp:57
constexpr auto fmod(double x, double y) noexcept -> double
Definition fmod.hpp:49
constexpr auto fmodf(float x, float y) noexcept -> float
Definition fmod.hpp:45
constexpr auto fmod(float x, float y) noexcept -> float
Definition fmod.hpp:41
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