2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Update fptraits.hpp for gcc/windows/aarch64.

Also adds better error checking.
Fixes #1348
This commit is contained in:
jzmaddock
2026-01-13 12:09:13 +00:00
parent 1d670c85b4
commit b390d093df

View File

@@ -24,6 +24,7 @@ With these techniques, the code could be simplified.
#include <cstring>
#include <cstdint>
#include <limits>
#include <climits>
#include <type_traits>
#include <boost/math/tools/config.hpp>
#include <boost/math/tools/is_standalone.hpp>
@@ -270,7 +271,10 @@ template<> struct fp_traits_non_native<double, double_precision>
// 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<long double, double_precision>
{
@@ -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<long double, extended_double_precision>
{
@@ -356,6 +362,8 @@ struct fp_traits_non_native<long double, extended_double_precision>
// 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<long double, extended_double_precision>
{
@@ -430,6 +438,8 @@ struct fp_traits_non_native<long double, extended_double_precision>
// 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<long double, extended_double_precision>
{