Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73312 - sandbox/e_float/libs/e_float/src/e_float/efx
From: e_float_at_[hidden]
Date: 2011-07-23 09:36:25


Author: christopher_kormanyos
Date: 2011-07-23 09:36:24 EDT (Sat, 23 Jul 2011)
New Revision: 73312
URL: http://svn.boost.org/trac/boost/changeset/73312

Log:
- Corrected errors that were made while correcting efx::e_float's ctor from double and wr_string function.
Text files modified:
   sandbox/e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp | 23 +++++++++--------------
   1 files changed, 9 insertions(+), 14 deletions(-)

Modified: sandbox/e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp
==============================================================================
--- sandbox/e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp (original)
+++ sandbox/e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp 2011-07-23 09:36:24 EDT (Sat, 23 Jul 2011)
@@ -443,7 +443,7 @@
 
       b_copy = true;
     }
-
+
     // Addition algorithm
     UINT32 carry = static_cast<UINT32>(0u);
 
@@ -453,7 +453,7 @@
       carry = t / static_cast<UINT32>(ef_elem_mask);
       p_u[j] = static_cast<UINT32>(t - static_cast<UINT32>(carry * static_cast<UINT32>(ef_elem_mask)));
     }
-
+
     if(b_copy)
     {
       data = n_data;
@@ -1465,20 +1465,15 @@
 
   // Add the digits after the decimal point.
 
+ for(std::size_t i = static_cast<std::size_t>(1u); i < static_cast<std::size_t>(ef_elem_number); i++)
   {
     std::stringstream ss;
- ss.width(static_cast<std::streamsize>(ef_elem_digits10));
- ss.fill(static_cast<char>('0'));
 
- for(std::size_t i = static_cast<std::size_t>(1u); i < static_cast<std::size_t>(ef_elem_number); i++)
- {
- ss << data[i];
-
- str += ss.str();
+ ss << std::setw(static_cast<std::streamsize>(ef_elem_digits10))
+ << std::setfill(static_cast<char>('0'))
+ << data[i];
 
- ss.str("");
- ss.clear();
- }
+ str += ss.str();
   }
 
   // Cut the output to the size of the precision.
@@ -1751,7 +1746,7 @@
         std::size_t n_shift = static_cast<std::size_t>(0u);
   const std::size_t n_exp_rem = static_cast<std::size_t>(exp % static_cast<INT64>(ef_elem_digits10));
 
- if(exp % static_cast<INT64>(ef_elem_digits10))
+ if((exp % static_cast<INT64>(ef_elem_digits10)) != static_cast<INT64>(0))
   {
     n_shift = ((exp < static_cast<INT64>(0))
                 ? static_cast<std::size_t>(n_exp_rem + static_cast<std::size_t>(ef_elem_digits10))
@@ -1771,7 +1766,7 @@
   }
 
   // Do the decimal point shift.
- if(n_shift)
+ if(n_shift != static_cast<std::size_t>(0u))
   {
     str.insert(static_cast<std::size_t>(pos_plus_one + n_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