[/ Copyright (c) 2021 - 2022 Matt Borland Use, modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ] [section:ccmath Constexpr CMath] [heading Description] `Constexpr` implementations of the functionality found in `` and `` [@https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf proposed for C++23]. In a `constexpr` context the functions will use an implementation defined in boost. If the context is not `constexpr` the functionality will be directly from the STL implementation of `` used by the compiler. All functions that take an `Integer` type and return a `double` simply cast the `Integer` argument to a `double`. All of the following functions require C++17 or greater. [heading Synopsis] `` #include `` namespace boost::math::ccmath { template inline constexpr bool isinf(T x); template inline constexpr bool isnan(T x); template inline constexpr Real sqrt(Real x); template inline constexpr double sqrt(Integer x); template inline constexpr T abs(T x); template , bool> = true> inline constexpr int abs(T x); template inline constexpr T fabs(T x); template inline constexpr bool isfinite(T x); template inline constexpr bool isnormal(T x); template inline constexpr int fpclassify(T x); template inline constexpr Real frexp(Real arg, int* exp); template inline constexpr double frexp(Integer arg, int* exp); template inline constexpr Real ldexp(Real arg, int exp); template inline constexpr double ldexp(Integer arg, int exp); template struct div_t {Integer quot; Integer rem;}; template inline constexpr div_t div(Integer x, Integer y); template inline constexpr Real logb(Real arg); template inline constexpr double logb(Integer arg); template inline constexpr int ilogb(T arg); template inline constexpr Real scalbn(Real x, int exp) noexcept template inline constexpr double scalbn(Integer x, int exp) noexcept template inline constexpr Real scalbln(Real x, long exp) noexcept template inline constexpr double scalbln(Integer x, long exp) noexcept template inline constexpr Real floor(Real arg) noexcept template inline constexpr double floor(Integer arg) noexcept template inline constexpr Real ceil(Real arg) noexcept template inline constexpr double ceil(Integer arg) noexcept template inline constexpr Real trunc(Real arg) noexcept template inline constexpr double trunc(Integer arg) noexcept template inline constexpr Real modf(Real x, Real* iptr) noexcept template inline constexpr Real round(Real arg) noexcept template inline constexpr double round(Integer arg) noexcept template inline constexpr long lround(T arg) template inline constexpr long long llround(T arg) template inline constexpr Real fmod(Real x, Real y) noexcept template inline constexpr Promoted fmod(Arithmetic1 x, Arithmetic2 y) noexcept The Promoted return type will have at least double prescision, but be up to the highest precision argument. template inline constexpr Real remainder(Real x, Real y) noexcept template inline constexpr Promoted remainder(Arithmetic1 x, Arithmetic2 y) noexcept template inline constexpr Real copysign(Real mag, Real sgn) noexcept template inline constexpr Promoted copysign(Arithmetic1 mag, Arithmetic2 sgn) noexcept template inline constexpr Real hypot(Real x, Real y) noexcept template inline constexpr Promoted hypot(Arithmetic1 x, Arithmetic2 y) noexcept template inline constexpr Real fdim(Real x, Real y) noexcept template inline constexpr Promoted fdim(Arithmetic1 x, Arithmetic2 y) noexcept template inline constexpr Real fmax(Real x, Real y) noexcept template inline constexpr Promoted fmax(Arithmetic1 x, Arithmetic2 y) noexcept template inline constexpr Real fmin(Real x, Real y) noexcept template inline constexpr Promoted fmin(Arithmetic1 x, Arithmetic2 y) noexcept template inline constexpr bool isgreater(Arithmetic1 x, Arithmetic2 y) noexcept template inline constexpr bool isgreaterequal(Arithmetic1 x, Arithmetic2 y) noexcept template inline constexpr bool isless(Arithmetic1 x, Arithmetic2 y) noexcept template inline constexpr bool islessequal(Arithmetic1 x, Arithmetic2 y) noexcept template inline constexpr bool isunordered(T x, T y) noexcept template inline constexpr Real fma(Real x, Real y, Real z) noexcept Requires compiling with fma flag template inline constexpr Promoted fma(Arithmetic1 x, Arithmetic2 y, Arithmetic3 z) noexcept template constexpr Promoted nextafter(Arithmetic1 from, Arithmetic2 to) template constexpr Promoted nexttoward(T from, long double to) template constexpr bool signbit(T arg) } // Namespaces [endsect] [/section:ccmath Constexpr CMath]