[Boost-bugs] [Boost C++ Libraries] #2598: boost::format incorrectly handles infinity with %f format specifier

Subject: [Boost-bugs] [Boost C++ Libraries] #2598: boost::format incorrectly handles infinity with %f format specifier
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-12-18 10:51:36


#2598: boost::format incorrectly handles infinity with %f format specifier
------------------------------------------------------+---------------------
 Reporter: Rüdiger Brünner <rbruenner_at_[hidden]> | Owner: samuel_krempp
     Type: Bugs | Status: new
Milestone: Boost 1.38.0 | Component: format
  Version: Boost 1.36.0 | Severity: Problem
 Keywords: infinity %f format specifier |
------------------------------------------------------+---------------------
 Hello,

 the following code produces the error with MS Visual Studio 2005:

 double f = std::numeric_limits<double>::infinity();
 std::string str = boost::str(boost::format("%0.5f") % f);

 will result in a VERY LONG string:
 1000000000000 ... 000.#INF0

 The format specifiers %e, %g and %1% work correctly, however.
 The problem arises with version 1.33 and 1.36 of the Boost library.

 Thank you in advance for your assistance.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2598>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC