42 std::istringstream
in (std::ios::in | std::ios::out);
45 std::ostream
out (
in.rdbuf ());
58 const unsigned int u32_max =
UINT_MAX;
64 typedef unsigned long UInt64;
66#elif LONG_MAX < LLONG_MAX
69 typedef long long Int64;
70 typedef unsigned long long UInt64;
82 const Int64 i64_min = (UInt64 (-1) >> 1) + 1;
83 const Int64 i64_max = UInt64 (-1) >> 1;
85 const UInt64 u64_max = UInt64 (-1);
97 out <<
"int16_t min = "
98 << std::dec << std::setw (6) << i16_min <<
' '
99 << std::oct << std::setw (7) << i16_min <<
' '
100 << std::hex << i16_min <<
'\n';
102 out <<
"int16_t max = "
103 << std::dec << std::setw (6) << i16_max <<
' '
104 << std::oct << std::setw (7) << i16_max <<
' '
105 << std::hex << i16_max <<
'\n';
107 out <<
"uint16_t max = "
108 << std::dec << std::setw (6) << u16_max <<
' '
109 << std::oct << std::setw (7) << u16_max <<
' '
110 << std::hex << u16_max <<
'\n';
113 out <<
"int32_t min = "
114 << std::dec << std::setw (11) << i32_min <<
' '
115 << std::oct << std::setw (12) << i32_min <<
' '
116 << std::hex << i32_min <<
'\n';
118 out <<
"int32_t max = "
119 << std::dec << std::setw (11) << i32_max <<
' '
120 << std::oct << std::setw (12) << i32_max <<
' '
121 << std::hex << i32_max <<
'\n';
123 out <<
"uint32_t max = "
124 << std::dec << std::setw (11) << u32_max <<
' '
125 << std::oct << std::setw (12) << u32_max <<
' '
126 << std::hex << u32_max <<
'\n';
130 out <<
"int64_t min = "
131 << std::dec << std::setw (20) << i64_min <<
' '
132 << std::oct << std::setw (23) << i64_min <<
' '
133 << std::hex << i64_min <<
'\n';
135 out <<
"int64_t max = "
136 << std::dec << std::setw (20) << i64_max <<
' '
137 << std::oct << std::setw (23) << i64_max <<
' '
138 << std::hex << i64_max <<
'\n';
140 out <<
"uint64_t max = "
141 << std::dec << std::setw (20) << u64_max <<
' '
142 << std::oct << std::setw (23) << u64_max <<
' '
143 << std::hex << u64_max <<
'\n';
148 out <<
"int64_t min = -9223372036854775808 "
149 <<
"01000000000000000000000 "
150 <<
"0x8000000000000000\n";
152 out <<
"int64_t max = +9223372036854775807 "
153 <<
"0777777777777777777777 "
154 <<
"0x7fffffffffffffff\n";
156 out <<
"uint64_t max = 18446744073709551615 "
157 <<
"01777777777777777777777 "
158 <<
"0xffffffffffffffff\n";
162 const char sep[] =
"----------------------------------------";
165 out.write (sep, 10).put (
'\n');
172 const double pi = 3.14159123;
173 out << std::noshowpos
174 << std::setprecision (3)
175 << std::setfill (
'*')
181 std::cout <<
in.rdbuf ();