Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion include/boost/math/special_functions/detail/fp_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
{
Expand Down Expand Up @@ -305,6 +309,8 @@ template<> struct fp_traits_non_native<long double, double_precision>

// 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>
{
Expand Down Expand Up @@ -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!!");

Comment on lines 363 to +366
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the PowerPC case should we check both 106 and 113 for LDBL_MANT_DIG? I assume the original code is old enough that 106 was the only option at the time.

template<>
struct fp_traits_non_native<long double, extended_double_precision>
{
Expand Down Expand Up @@ -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>
{
Expand Down
Loading