Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86204 - sandbox/multiprecision.cpp_bin_float/boost/multiprecision
From: john_at_[hidden]
Date: 2013-10-08 13:15:17


Author: johnmaddock
Date: 2013-10-08 13:15:17 EDT (Tue, 08 Oct 2013)
New Revision: 86204
URL: http://svn.boost.org/trac/boost/changeset/86204

Log:
Fix bug in assignment of signed integers.

Text files modified:
   sandbox/multiprecision.cpp_bin_float/boost/multiprecision/cpp_bin_float.hpp | 5 +++--
   1 files changed, 3 insertions(+), 2 deletions(-)

Modified: sandbox/multiprecision.cpp_bin_float/boost/multiprecision/cpp_bin_float.hpp
==============================================================================
--- sandbox/multiprecision.cpp_bin_float/boost/multiprecision/cpp_bin_float.hpp Tue Oct 8 13:14:01 2013 (r86203)
+++ sandbox/multiprecision.cpp_bin_float/boost/multiprecision/cpp_bin_float.hpp 2013-10-08 13:15:17 EDT (Tue, 08 Oct 2013) (r86204)
@@ -205,8 +205,9 @@
       }
       else
       {
- I fi = boost::multiprecision::detail::abs(i);
- typedef typename boost::multiprecision::detail::canonical<I, rep_type>::type ar_type;
+ typedef typename make_unsigned<I>::type ui_type;
+ ui_type fi = static_cast<ui_type>(boost::multiprecision::detail::abs(i));
+ typedef typename boost::multiprecision::detail::canonical<ui_type, rep_type>::type ar_type;
          m_data = static_cast<ar_type>(fi);
          unsigned shift = msb(fi);
          m_exponent = shift;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk