diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:24:45 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:24:45 +0900 |
commit | 5ce1cfc2525b06c0a9e38531813781de0281c96d (patch) | |
tree | 19cc66c6cf6396db288813b2558cc350f1deede2 /boost/multiprecision/gmp.hpp | |
parent | 3c1df2168531ad5580076ae08d529054689aeedd (diff) | |
download | boost-5ce1cfc2525b06c0a9e38531813781de0281c96d.tar.gz boost-5ce1cfc2525b06c0a9e38531813781de0281c96d.tar.bz2 boost-5ce1cfc2525b06c0a9e38531813781de0281c96d.zip |
Imported Upstream version 1.71.0upstream/1.71.0
Diffstat (limited to 'boost/multiprecision/gmp.hpp')
-rw-r--r-- | boost/multiprecision/gmp.hpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/boost/multiprecision/gmp.hpp b/boost/multiprecision/gmp.hpp index 0f5800ed3d..a03b75b9c3 100644 --- a/boost/multiprecision/gmp.hpp +++ b/boost/multiprecision/gmp.hpp @@ -39,6 +39,7 @@ # define BOOST_MP_MPIR_VERSION 0 #endif +#include <cctype> #include <cmath> #include <limits> #include <climits> @@ -1328,11 +1329,13 @@ struct gmp_int std::string s = ps; mp_get_memory_functions(&alloc_func_ptr, &realloc_func_ptr, &free_func_ptr); (*free_func_ptr)((void*)ps, std::strlen(ps) + 1); - + if (f & std::ios_base::uppercase) + for (size_t i = 0; i < s.length(); ++i) + s[i] = std::toupper(s[i]); if((base != 10) && (f & std::ios_base::showbase)) { int pos = s[0] == '-' ? 1 : 0; - const char* pp = base == 8 ? "0" : "0x"; + const char* pp = base == 8 ? "0" : (f & std::ios_base::uppercase) ? "0X" : "0x"; s.insert(static_cast<std::string::size_type>(pos), pp); } if((f & std::ios_base::showpos) && (s[0] != '-')) |