diff --git a/include/boost/math/special_functions/detail/fp_traits.hpp b/include/boost/math/special_functions/detail/fp_traits.hpp index 051b84c1e..c6b46ef66 100644 --- a/include/boost/math/special_functions/detail/fp_traits.hpp +++ b/include/boost/math/special_functions/detail/fp_traits.hpp @@ -24,6 +24,7 @@ With these techniques, the code could be simplified. #include #include #include +#include #include #include #include @@ -270,7 +271,10 @@ template<> struct fp_traits_non_native // long double (64 bits) ------------------------------------------------------- #if defined(BOOST_NO_INT64_T) || defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)\ - || defined(BOOST_BORLANDC) || defined(__CODEGEAR__) || (defined(__APPLE__) && defined(__aarch64__)) || defined(_MSC_VER) + || defined(BOOST_BORLANDC) || defined(__CODEGEAR__) || (defined(__APPLE__) && defined(__aarch64__)) || defined(_MSC_VER)\ + || (defined(__GNUC__) && defined(__aarch64__)) + +static_assert(LDBL_MANT_DIG == 53, "Oops, assumption that long double is a 64-bit quantity is incorrect!!"); template<> struct fp_traits_non_native { @@ -305,6 +309,8 @@ private: // Intel extended double precision format (80 bits) +static_assert(LDBL_MANT_DIG == 64, "Oops, assumption that long double is an 80-bit quantity is incorrect!!"); + template<> struct fp_traits_non_native { @@ -356,6 +362,8 @@ struct fp_traits_non_native // PowerPC extended double precision format (128 bits) +static_assert(LDBL_MANT_DIG == 113, "Oops, assumption that long double is a 128-bit quantity is incorrect!!"); + template<> struct fp_traits_non_native { @@ -430,6 +438,8 @@ struct fp_traits_non_native // IEEE extended double precision format with 15 exponent bits (128 bits) +static_assert(LDBL_MANT_DIG == 113, "Oops, assumption that long double is a 128-bit quantity is incorrect!!"); + template<> struct fp_traits_non_native {