Opened 6 years ago
Last modified 6 years ago
#12211 new Bugs
boost::multiprecision cpp_int renders string inconsistently w.r.t. locale
Reported by: | Owned by: | John Maddock | |
---|---|---|---|
Milestone: | To Be Determined | Component: | multiprecision |
Version: | Boost 1.59.0 | Severity: | Problem |
Keywords: | Cc: |
Description
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.
Attachments (1)
Change History (2)
by , 6 years ago
Attachment: | bug_multiprecision_locale_str.cpp added |
---|
Confirmed. I do know that a lot more work needs to be done in this area.