3#ifndef TETL_CMATH_COPYSIGN_HPP
4#define TETL_CMATH_COPYSIGN_HPP
15constexpr auto copysign_fallback(T x, T y)
noexcept -> T
17 if ((x < 0 and y > 0) or (x > 0 and y < 0)) {
24[[nodiscard]]
constexpr auto copysign(T x, T y)
noexcept -> T
28#if __has_builtin(__builtin_copysignf)
29 return __builtin_copysignf(x, y);
33#if __has_builtin(__builtin_copysign)
34 return __builtin_copysign(x, y);
38 return copysign_fallback(x, y);
58[[nodiscard]]
constexpr auto copysign(
float mag,
float sgn) ->
float {
return detail::copysign(mag, sgn); }
59[[nodiscard]]
constexpr auto copysignf(
float mag,
float sgn) ->
float {
return detail::copysign(mag, sgn); }
60[[nodiscard]]
constexpr auto copysign(
double mag,
double sgn) ->
double {
return detail::copysign(mag, sgn); }
61[[nodiscard]]
constexpr auto copysign(
long double mag,
long double sgn) ->
long double
63 return detail::copysign(mag, sgn);
66[[nodiscard]]
constexpr auto copysignl(
long double mag,
long double sgn) ->
long double
68 return detail::copysign(mag, sgn);
constexpr auto copysign(float mag, float sgn) -> float
Composes a floating point value with the magnitude of mag and the sign of sgn.
Definition copysign.hpp:58
constexpr auto copysignf(float mag, float sgn) -> float
Composes a floating point value with the magnitude of mag and the sign of sgn.
Definition copysign.hpp:59
constexpr auto copysignl(long double mag, long double sgn) -> long double
Composes a floating point value with the magnitude of mag and the sign of sgn.
Definition copysign.hpp:66
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