6#ifndef SL_UTILITY_MATH_HPP
7#define SL_UTILITY_MATH_HPP
14#if __cpp_lib_constexpr_cmath >= 202202L
15#define SL_CONSTEXPR_MATH constexpr
17#define SL_CONSTEXPR_MATH
30 template <std::
floating_po
int T>
57 requires requires { std::remquo(x, x,
nullptr); }
60 const auto remainder{std::remquo(x, y, &quo)};
68 template <std::
floating_po
int T>
93 requires requires { std::frexp(
value,
nullptr); }
96 const auto fraction{std::frexp(value, &exp)};
104 template <std::
floating_po
int T>
122 T fraction{std::modf(
value, &integral)};
Checks whether the given template type is usable as value type for unique_handle types.
Definition: unique_handle.hpp:161
constexpr auto frexp
Decomposes given floating point value into a normalized fraction and an integral power of two.
Definition: math.hpp:92
frexp_result(T, int) -> frexp_result< T >
Manual deduction guide for the frexp_result type.
remquo_result(T, int) -> remquo_result< T >
Manual deduction guide for the remquo_result type.
constexpr auto remquo
Computes the floating-point remainder of the division operation x/y. Additionally,...
Definition: math.hpp:56
constexpr auto modf
Decomposes given floating point value into integral and fractional parts, each having the same type a...
Definition: math.hpp:119
#define SL_CONSTEXPR_MATH
Definition: math.hpp:17
Result type for the frexp operation.
Definition: math.hpp:70
int exp
Definition: math.hpp:72
T fraction
Definition: math.hpp:71
Result type for the modf operation.
Definition: math.hpp:106
T integral
Definition: math.hpp:107
T fraction
Definition: math.hpp:108
Result type for the remquo operation.
Definition: math.hpp:32
int quo
Definition: math.hpp:34
T remainder
Definition: math.hpp:33