Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75603 - sandbox/big_number/boost/multiprecision
From: john_at_[hidden]
Date: 2011-11-22 05:07:25


Author: johnmaddock
Date: 2011-11-22 05:07:24 EST (Tue, 22 Nov 2011)
New Revision: 75603
URL: http://svn.boost.org/trac/boost/changeset/75603

Log:
Fix bug in previous formatting code.
Text files modified:
   sandbox/big_number/boost/multiprecision/cpp_float.hpp | 4 ++--
   1 files changed, 2 insertions(+), 2 deletions(-)

Modified: sandbox/big_number/boost/multiprecision/cpp_float.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/cpp_float.hpp (original)
+++ sandbox/big_number/boost/multiprecision/cpp_float.hpp 2011-11-22 05:07:24 EST (Tue, 22 Nov 2011)
@@ -1755,13 +1755,13 @@
       str.append(1, 'e');
       str.append(boost::lexical_cast<std::string>(my_exp));
    }
- if(showpoint || scientific)
+ if((showpoint || scientific) && (number_of_digits != (std::numeric_limits<std::size_t>::max)()))
    {
       std::streamsize chars = str.size() - 1;
       BOOST_ASSERT(str.find('.') != std::string::npos); // there must be a decimal point!!
       chars = number_of_digits - chars;
       if(chars > 0)
- str.append(chars, '0');
+ str.append(static_cast<std::string::size_type>(chars), '0');
    }
    if(isneg())
       str.insert(0, 1, '-');


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