10template <
class T>
struct math_constants
14 requires(std::same_as<T, float> || std::same_as<T, double> || std::same_as<T, long double>
16 || std::same_as<T, float128>
19struct math_constants<T>
21 static constexpr T
pi = std::numbers::pi_v<T>;
22 static constexpr T
log_two = std::numbers::ln2_v<T>;
23 static constexpr T
euler_gamma = std::numbers::egamma_v<T>;
27 static constexpr T
catalan = T(0xea7cb89f409ae845ULL) * T(0x1p-64L) + T(0x215822e37d32d0c6ULL) * T(0x1p-128L);
36 requires requires { detail::math_constants<Real>::pi; }
37inline constexpr auto pi = detail::math_constants<Real>::pi;
41 requires requires { detail::math_constants<Real>::log_two; }
42inline constexpr auto log_two = detail::math_constants<Real>::log_two;
46 requires requires { detail::math_constants<Real>::euler_gamma; }
47inline constexpr auto euler_gamma = detail::math_constants<Real>::euler_gamma;
51 requires requires { detail::math_constants<Real>::catalan; }
52inline constexpr auto catalan = detail::math_constants<Real>::catalan;
Definition async/async.hpp:26
constexpr auto pi
Pi as a native constant or a precision-aware MPFR descriptor.
Definition math_constants.hpp:37
constexpr auto euler_gamma
Euler-Mascheroni constant, with the same type and precision rules as pi.
Definition math_constants.hpp:47
constexpr auto catalan
Catalan constant as a native value or a precision-aware MPFR descriptor.
Definition math_constants.hpp:52
constexpr auto log_two
Natural logarithm of two, with the same type and precision rules as pi.
Definition math_constants.hpp:42