// Distributed under the Boost Software License Version 1.0 https://www.boost.org/LICENSE_1_0.txt // Copyright Gero Peterhoff #ifndef BOOST_MATH_CSTDFLOAT_TYPES_MORE_HPP #define BOOST_MATH_CSTDFLOAT_TYPES_MORE_HPP #include #include #if !defined(BOOST_NO_CXX23_HDR_STDFLOAT) #include #endif #if defined(__STDCPP_FLOAT128_T__) #define BOOST_FLOAT128_C_OR_ZERO(x) BOOST_JOIN(x, F128) #elif defined(BOOST_CSTDFLOAT_FLOAT128_NATIVE_TYPE) #define BOOST_FLOAT128_C_OR_ZERO(x) BOOST_FLOAT128_C(x) #else #define BOOST_FLOAT128_C_OR_ZERO(x) 0 #endif #if defined(BOOST_CSTDFLOAT_FLOAT80_NATIVE_TYPE) #define BOOST_FLOAT80_C_OR_ZERO(x) BOOST_FLOAT80_C(x) #else #define BOOST_FLOAT80_C_OR_ZERO(x) 0 #endif #if defined(__STDCPP_FLOAT64_T__) #define BOOST_FLOAT64_C_OR_ZERO(x) BOOST_JOIN(x, F64) #elif defined(BOOST_CSTDFLOAT_FLOAT64_NATIVE_TYPE) #define BOOST_FLOAT64_C_OR_ZERO(x) BOOST_FLOAT64_C(x) #else #define BOOST_FLOAT64_C_OR_ZERO(x) 0 #endif #if defined(__STDCPP_FLOAT32_T__) #define BOOST_FLOAT32_C_OR_ZERO(x) BOOST_JOIN(x, F32) #elif defined(BOOST_CSTDFLOAT_FLOAT32_NATIVE_TYPE) #define BOOST_FLOAT32_C_OR_ZERO(x) BOOST_FLOAT32_C(x) #else #define BOOST_FLOAT32_C_OR_ZERO(x) 0 #endif #if defined(__STDCPP_FLOAT16_T__) #define BOOST_FLOAT16_C_OR_ZERO(x) BOOST_JOIN(x, F16) #elif defined(BOOST_CSTDFLOAT_FLOAT16_NATIVE_TYPE) #define BOOST_FLOAT16_C_OR_ZERO(x) BOOST_FLOAT16_C(x) #else #define BOOST_FLOAT16_C_OR_ZERO(x) 0 #endif #if defined(__STDCPP_BFLOAT16_T__) #define BOOST_BFLOAT16_C_OR_ZERO(x) BOOST_JOIN(x, BF16) #else #define BOOST_BFLOAT16_C_OR_ZERO(x) 0 #endif namespace boost { namespace platform { // provides correct min/max-types // prefers standard types first #if defined(__STDCPP_FLOAT128_T__) using floatmax_t = std::float128_t; #elif defined(BOOST_CSTDFLOAT_FLOAT128_NATIVE_TYPE) using floatmax_t = boost::float128_t; #elif defined(BOOST_CSTDFLOAT_FLOAT80_NATIVE_TYPE) using floatmax_t = boost::float80_t; #elif defined(__STDCPP_FLOAT64_T__) using floatmax_t = std::float64_t; #elif defined(BOOST_CSTDFLOAT_FLOAT64_NATIVE_TYPE) using floatmax_t = boost::float64_t; #elif defined(__STDCPP_FLOAT32_T__) using floatmax_t = std::float32_t; #elif defined(BOOST_CSTDFLOAT_FLOAT32_NATIVE_TYPE) using floatmax_t = boost::float32_t; #elif defined(__STDCPP_BFLOAT16_T__) using floatmax_t = std::bfloat16_t; #elif defined(__STDCPP_FLOAT16_T__) using floatmax_t = std::float16_t; #elif defined(BOOST_CSTDFLOAT_FLOAT16_NATIVE_TYPE) using floatmax_t = boost::float16_t; #else static_assert(false, "invalid floatmax type"); #endif #if defined(__STDCPP_FLOAT16_T__) using floatmin_t = std::float16_t; #elif defined(BOOST_CSTDFLOAT_FLOAT16_NATIVE_TYPE) using floatmin_t = boost::float16_t; #elif defined(__STDCPP_BFLOAT16_T__) using floatmin_t = std::bfloat16_t; #elif defined(__STDCPP_FLOAT32_T__) using floatmin_t = std::float32_t; #elif defined(BOOST_CSTDFLOAT_FLOAT32_NATIVE_TYPE) using floatmin_t = boost::float32_t; #elif defined(__STDCPP_FLOAT64_T__) using floatmin_t = std::float64_t; #elif defined(BOOST_CSTDFLOAT_FLOAT64_NATIVE_TYPE) using floatmin_t = boost::float64_t; #elif defined(BOOST_CSTDFLOAT_FLOAT80_NATIVE_TYPE) using floatmin_t = boost::float80_t; #elif defined(__STDCPP_FLOAT128_T__) using floatmin_t = std::float128_t; #elif defined(BOOST_CSTDFLOAT_FLOAT128_NATIVE_TYPE) using floatmin_t = boost::float128_t; #else static_assert(false, "invalid floatmin type"); #endif } // platform } // boost #endif // BOOST_MATH_CSTDFLOAT_TYPES_MORE_HPP