Skip to content

Commit

Permalink
math: Fix fp_traits for IBM long double
Browse files Browse the repository at this point in the history
This patch fixes the fp_traits_non_native template specialization for
IBM long double.  Current interface does not work correctly for the type
due the fact for some operations (sign manipulation, for instance), both
double should be manipulated.  For other operations that only require
the 32 most significand bits (isinf/isnan for instance), the double
specialization is suffice.

This fixes the issues for getometry test in PPC64LE environment with no
regreesions on PPC64BE.
  • Loading branch information
Adhemerval Zanella committed Apr 22, 2014
1 parent e0fc16e commit 4426b41
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion boost/math/special_functions/detail/fp_traits.hpp
Expand Up @@ -359,6 +359,13 @@ struct fp_traits_non_native<long double, extended_double_precision>

// PowerPC extended double precision format (128 bits)

// Current 'fp_traits_non_native' does not work correctly with IBM long double
// due the fact for some operations, like sign manipulation, the algorithm
// should manipulate both 'double' value. For algorithms that only depend on
// the most significand 32 bits (for instance, isinf or isnan), using the
// template double especialization is suffice.

#if 0
template<>
struct fp_traits_non_native<long double, extended_double_precision>
{
Expand Down Expand Up @@ -391,7 +398,7 @@ struct fp_traits_non_native<long double, extended_double_precision>
BOOST_STATIC_ASSERT(false);
#endif
};

#endif

// long double (>64 bits), Motorola 68K ----------------------------------------

Expand Down

0 comments on commit 4426b41

Please sign in to comment.