Skip to content

Commit 0992ba6

Browse files
authored
Merge pull request #1283 from boostorg/ldbl
Add macOS long double to fp_traits for double precision
2 parents 004b138 + 008a31c commit 0992ba6

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

include/boost/math/special_functions/detail/fp_traits.hpp

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ template<> struct fp_traits_non_native<double, double_precision>
270270
// long double (64 bits) -------------------------------------------------------
271271

272272
#if defined(BOOST_NO_INT64_T) || defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)\
273-
|| defined(BOOST_BORLANDC) || defined(__CODEGEAR__)
273+
|| defined(BOOST_BORLANDC) || defined(__CODEGEAR__) || (defined(__APPLE__) && defined(__aarch64__)) || defined(_MSC_VER)
274274

275275
template<> struct fp_traits_non_native<long double, double_precision>
276276
{
@@ -297,31 +297,9 @@ template<> struct fp_traits_non_native<long double, double_precision>
297297
static constexpr int offset_ = BOOST_MATH_ENDIAN_BIG_BYTE ? 0 : 4;
298298
};
299299

300-
//..............................................................................
301-
302-
#else
303-
304-
template<> struct fp_traits_non_native<long double, double_precision>
305-
{
306-
typedef ieee_copy_all_bits_tag method;
307-
308-
static const uint64_t sign = static_cast<uint64_t>(0x80000000u) << 32;
309-
static const uint64_t exponent = static_cast<uint64_t>(0x7ff00000) << 32;
310-
static const uint64_t flag = 0;
311-
static const uint64_t significand
312-
= (static_cast<uint64_t>(0x000fffff) << 32) + static_cast<uint64_t>(0xffffffffu);
313-
314-
typedef uint64_t bits;
315-
static void get_bits(long double x, uint64_t& a) { std::memcpy(&a, &x, 8); }
316-
static void set_bits(long double& x, uint64_t a) { std::memcpy(&x, &a, 8); }
317-
};
318-
319-
#endif
320-
321-
322300
// long double (>64 bits), x86 and x64 -----------------------------------------
323301

324-
#if defined(__i386) || defined(__i386__) || defined(_M_IX86) \
302+
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86) \
325303
|| defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) \
326304
|| defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)
327305

0 commit comments

Comments
 (0)