// Distributed under the Boost Software License Version 1.0 https://www.boost.org/LICENSE_1_0.txt // Copyright Gero Peterhoff #ifndef BOOST_CONFIG_FLOAT_HPP #define BOOST_CONFIG_FLOAT_HPP #include #include #include #if !defined(BOOST_NO_CXX23_HDR_STDFLOAT) #include #endif namespace boost { #if !defined(BOOST_HAS_FLOAT128) #define BOOST_NO_FLOAT128_T #endif #if !defined(BOOST_CSTDFLOAT_FLOAT80_NATIVE_TYPE) #define BOOST_NO_FLOAT80_T #endif #if !defined(BOOST_CSTDFLOAT_FLOAT64_NATIVE_TYPE) #define BOOST_NO_FLOAT64_T #endif #if !defined(BOOST_CSTDFLOAT_FLOAT32_NATIVE_TYPE) #define BOOST_NO_FLOAT32_T #endif #if !defined(BOOST_CSTDFLOAT_FLOAT16_NATIVE_TYPE) #define BOOST_NO_FLOAT16_T #endif namespace platform { // provides correct min/max-types #if defined(__STDCPP_FLOAT128_T__) || !defined(BOOST_NO_FLOAT128_T) #if defined(__STDCPP_FLOAT128_T__) using floatmax_t = std::float128_t; #else using floatmax_t = boost::float128_t; #endif #elif !defined(BOOST_NO_FLOAT80_T) using floatmax_t = boost::float80_t; #elif defined(__STDCPP_FLOAT64_T__) || !defined(BOOST_NO_FLOAT64_T) #if defined(__STDCPP_FLOAT64_T__) using floatmax_t = std::float64_t; #else using floatmax_t = boost::float64_t; #endif #elif defined(__STDCPP_FLOAT32_T__) || !defined(BOOST_NO_FLOAT32_T) #if defined(__STDCPP_FLOAT32_T__) using floatmax_t = std::float32_t; #else using floatmax_t = boost::float32_t; #endif #elif defined(__STDCPP_BFLOAT16_T__) using floatmax_t = std::bfloat16_t; #elif defined(__STDCPP_FLOAT16_T__) || !defined(BOOST_NO_FLOAT16_T) #if defined(__STDCPP_FLOAT16_T__) using floatmax_t = std::float16_t; #else using floatmax_t = boost::float16_t; #endif #else static_assert(false); #endif #if defined(__STDCPP_FLOAT16_T__) || !defined(BOOST_NO_FLOAT16_T) #if defined(__STDCPP_FLOAT16_T__) using floatmin_t = std::float16_t; #else using floatmin_t = boost::float16_t; #endif #elif defined(__STDCPP_FLOAT16_T__) using floatmin_t = std::bfloat16_t; #elif defined(__STDCPP_FLOAT32_T__) || !defined(BOOST_NO_FLOAT32_T) #if defined(__STDCPP_FLOAT32_T__) using floatmin_t = std::float32_t; #else using floatmin_t = boost::float32_t; #endif #elif defined(__STDCPP_FLOAT64_T__) || !defined(BOOST_NO_FLOAT64_T) #if defined(__STDCPP_FLOAT64_T__) using floatmin_t = std::float64_t; #else using floatmin_t = boost::float64_t; #endif #elif !defined(BOOST_NO_FLOAT80_T) using floatmin_t = float80_t; #elif defined(__STDCPP_FLOAT128_T__) || !defined(BOOST_NO_FLOAT128_T) #if defined(__STDCPP_FLOAT128_T__) using floatmin_t = std::float128_t; #else using floatmin_t = boost::float128_t; #endif #else static_assert(false); #endif } // platform } // boost #endif // BOOST_CONFIG_FLOAT_HPP