From c2b706da151ee809f6980182db6a6dc5b0ee0a7d Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 3 Sep 2015 18:43:05 +0100 Subject: [PATCH] Add __float128 support. --- include/boost/math/tools/promotion.hpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/include/boost/math/tools/promotion.hpp b/include/boost/math/tools/promotion.hpp index b3ad20407..494d7f99e 100644 --- a/include/boost/math/tools/promotion.hpp +++ b/include/boost/math/tools/promotion.hpp @@ -86,13 +86,20 @@ namespace boost typedef typename mpl::if_< typename mpl::and_, is_floating_point >::type, // both T1P and T2P are floating-point? - typename mpl::if_< typename mpl::or_, is_same >::type, // either long double? - long double, // then result type is long double. - typename mpl::if_< typename mpl::or_, is_same >::type, // either double? - double, // result type is double. - float // else result type is float. - >::type - >::type, +#ifdef BOOST_MATH_USE_FLOAT128 + typename mpl::if_< typename mpl::or_, is_same<__float128, T2P> >::type, // either long double? + __float128, +#endif + typename mpl::if_< typename mpl::or_, is_same >::type, // either long double? + long double, // then result type is long double. + typename mpl::if_< typename mpl::or_, is_same >::type, // either double? + double, // result type is double. + float // else result type is float. + >::type +#ifdef BOOST_MATH_USE_FLOAT128 + >::type +#endif + >::type, // else one or the other is a user-defined type: typename mpl::if_< typename mpl::and_ >, ::boost::is_convertible >, T2P, T1P>::type>::type type; }; // promote_arg2