diff options
Diffstat (limited to 'boost/math/tools/promotion.hpp')
-rw-r--r-- | boost/math/tools/promotion.hpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/boost/math/tools/promotion.hpp b/boost/math/tools/promotion.hpp index b3ad204077..494d7f99e2 100644 --- a/boost/math/tools/promotion.hpp +++ b/boost/math/tools/promotion.hpp @@ -86,13 +86,20 @@ namespace boost typedef typename mpl::if_< typename mpl::and_<is_floating_point<T1P>, is_floating_point<T2P> >::type, // both T1P and T2P are floating-point? - typename mpl::if_< typename mpl::or_<is_same<long double, T1P>, is_same<long double, T2P> >::type, // either long double? - long double, // then result type is long double. - typename mpl::if_< typename mpl::or_<is_same<double, T1P>, is_same<double, T2P> >::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, T1P>, is_same<__float128, T2P> >::type, // either long double? + __float128, +#endif + typename mpl::if_< typename mpl::or_<is_same<long double, T1P>, is_same<long double, T2P> >::type, // either long double? + long double, // then result type is long double. + typename mpl::if_< typename mpl::or_<is_same<double, T1P>, is_same<double, T2P> >::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_<mpl::not_<is_floating_point<T2P> >, ::boost::is_convertible<T1P, T2P> >, T2P, T1P>::type>::type type; }; // promote_arg2 |