From 733b5d5ae2c5d625211e2985ac25728ac3f54883 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Mon, 21 Mar 2016 15:45:20 +0900 Subject: Imported Upstream version 1.58.0 Change-Id: If0072143aa26874812e0db6872e1efb10a3e5e94 Signed-off-by: DongHun Kwak --- boost/multiprecision/detail/number_base.hpp | 34 +++++++++++++++++++---------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'boost/multiprecision/detail/number_base.hpp') diff --git a/boost/multiprecision/detail/number_base.hpp b/boost/multiprecision/detail/number_base.hpp index 9353082d37..09c86e6ce0 100644 --- a/boost/multiprecision/detail/number_base.hpp +++ b/boost/multiprecision/detail/number_base.hpp @@ -145,6 +145,18 @@ struct canonical_imp, Backend, Tag> { typedef B type; }; +#ifdef __SUNPRO_CC +template +struct canonical_imp, Backend, mpl::int_<3> > +{ + typedef B type; +}; +template +struct canonical_imp, Backend, mpl::int_<3> > +{ + typedef B type; +}; +#endif template struct canonical_imp > { @@ -606,9 +618,9 @@ void format_float_string(S& str, boost::intmax_t my_exp, boost::intmax_t digits, } } if(neg) - str.insert(0, 1, '-'); + str.insert(static_cast(0), 1, '-'); else if(showpos) - str.insert(0, 1, '+'); + str.insert(static_cast(0), 1, '+'); return; } @@ -653,8 +665,8 @@ void format_float_string(S& str, boost::intmax_t my_exp, boost::intmax_t digits, { if(my_exp < 0) { - str.insert(0, static_cast(-1 - my_exp), '0'); - str.insert(0, "0."); + str.insert(static_cast(0), static_cast(-1 - my_exp), '0'); + str.insert(static_cast(0), "0."); } else { @@ -679,21 +691,21 @@ void format_float_string(S& str, boost::intmax_t my_exp, boost::intmax_t digits, BOOST_MP_USING_ABS // Scientific format: if(showpoint || (str.size() > 1)) - str.insert(1, 1, '.'); - str.append(1, 'e'); + str.insert(static_cast(1u), 1, '.'); + str.append(static_cast(1u), 'e'); S e = boost::lexical_cast(abs(my_exp)); if(e.size() < BOOST_MP_MIN_EXPONENT_DIGITS) - e.insert(0, BOOST_MP_MIN_EXPONENT_DIGITS-e.size(), '0'); + e.insert(static_cast(0), BOOST_MP_MIN_EXPONENT_DIGITS - e.size(), '0'); if(my_exp < 0) - e.insert(0, 1, '-'); + e.insert(static_cast(0), 1, '-'); else - e.insert(0, 1, '+'); + e.insert(static_cast(0), 1, '+'); str.append(e); } if(neg) - str.insert(0, 1, '-'); + str.insert(static_cast(0), 1, '-'); else if(showpos) - str.insert(0, 1, '+'); + str.insert(static_cast(0), 1, '+'); } template -- cgit v1.2.3