File indexing completed on 2025-01-18 09:42:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_MP_DETAIL_ITOS_HPP
0011 #define BOOST_MP_DETAIL_ITOS_HPP
0012
0013 namespace boost { namespace multiprecision { namespace detail {
0014
0015 template <class Integer>
0016 std::string itos(Integer val)
0017 {
0018 if (!val) return "0";
0019 std::string result;
0020 bool isneg = false;
0021 if (val < 0)
0022 {
0023 val = -val;
0024 isneg = true;
0025 }
0026 while (val)
0027 {
0028 result.insert(result.begin(), char('0' + (val % 10)));
0029 val /= 10;
0030 }
0031 if (isneg)
0032 result.insert(result.begin(), '-');
0033 return result;
0034 }
0035
0036
0037 }}}
0038
0039 #endif