[Boost-bugs] [Boost C++ Libraries] #12211: boost::multiprecision cpp_int renders string inconsistently w.r.t. locale

Subject: [Boost-bugs] [Boost C++ Libraries] #12211: boost::multiprecision cpp_int renders string inconsistently w.r.t. locale
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-05-17 08:08:49


#12211: boost::multiprecision cpp_int renders string inconsistently w.r.t. locale
-------------------------------------------------+-------------------------
 Reporter: Tassilo Glander <tassilo.glander@…> | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component:
  Version: Boost 1.59.0 | multiprecision
 Keywords: | Severity: Problem
-------------------------------------------------+-------------------------
 When a global locale is set that differs from the classic one, the string
 output is inconsistent for small numbers, i.e. that fit into one limb, vs
 bigger numbers. If the locale defines a thousands separator, it is
 rendered for the small number but not for the bigger number.
 Example: str() will render 9.999 but also 9999999999999999

 The reason is the different internal handling of these cases: a small
 number is rendered using boost lexical_cast, which evaluates the global
 locale, while the bigger number is constructed by hand.

 Required behavior is that the output is consistent regardless of the size
 of the number.
 In addition, it would be nice if str() would use the global locale, while
 the stream output respects the locale imbued into the given stream.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12211>
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:50:20 UTC