diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-03-21 15:45:20 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-03-21 15:46:37 +0900 |
commit | 733b5d5ae2c5d625211e2985ac25728ac3f54883 (patch) | |
tree | a5b214744b256f07e1dc2bd7273035a7808c659f /boost/multiprecision/detail/number_base.hpp | |
parent | 08c1e93fa36a49f49325a07fe91ff92c964c2b6c (diff) | |
download | boost-733b5d5ae2c5d625211e2985ac25728ac3f54883.tar.gz boost-733b5d5ae2c5d625211e2985ac25728ac3f54883.tar.bz2 boost-733b5d5ae2c5d625211e2985ac25728ac3f54883.zip |
Imported Upstream version 1.58.0upstream/1.58.0
Change-Id: If0072143aa26874812e0db6872e1efb10a3e5e94
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/multiprecision/detail/number_base.hpp')
-rw-r--r-- | boost/multiprecision/detail/number_base.hpp | 34 |
1 files changed, 23 insertions, 11 deletions
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<number<B, et_off>, Backend, Tag> { typedef B type; }; +#ifdef __SUNPRO_CC +template <class B, class Backend> +struct canonical_imp<number<B, et_on>, Backend, mpl::int_<3> > +{ + typedef B type; +}; +template <class B, class Backend> +struct canonical_imp<number<B, et_off>, Backend, mpl::int_<3> > +{ + typedef B type; +}; +#endif template <class Val, class Backend> struct canonical_imp<Val, Backend, mpl::int_<0> > { @@ -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<std::string::size_type>(0), 1, '-'); else if(showpos) - str.insert(0, 1, '+'); + str.insert(static_cast<std::string::size_type>(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<std::string::size_type>(-1 - my_exp), '0'); - str.insert(0, "0."); + str.insert(static_cast<std::string::size_type>(0), static_cast<std::string::size_type>(-1 - my_exp), '0'); + str.insert(static_cast<std::string::size_type>(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<std::string::size_type>(1u), 1, '.'); + str.append(static_cast<std::string::size_type>(1u), 'e'); S e = boost::lexical_cast<S>(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<std::string::size_type>(0), BOOST_MP_MIN_EXPONENT_DIGITS - e.size(), '0'); if(my_exp < 0) - e.insert(0, 1, '-'); + e.insert(static_cast<std::string::size_type>(0), 1, '-'); else - e.insert(0, 1, '+'); + e.insert(static_cast<std::string::size_type>(0), 1, '+'); str.append(e); } if(neg) - str.insert(0, 1, '-'); + str.insert(static_cast<std::string::size_type>(0), 1, '-'); else if(showpos) - str.insert(0, 1, '+'); + str.insert(static_cast<std::string::size_type>(0), 1, '+'); } template <class V> |