Chromium Code Reviews| Index: src/types.cc |
| diff --git a/src/types.cc b/src/types.cc |
| index 162c35ac8353fea7a5a4de07b436450178cb98bb..aacd6465a0c99d2ec37c5e1dd343105cce20fd68 100644 |
| --- a/src/types.cc |
| +++ b/src/types.cc |
| @@ -2,6 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include <iomanip> |
| + |
| #include "src/types.h" |
| #include "src/ostreams.h" |
| @@ -1017,8 +1019,13 @@ void TypeImpl<Config>::PrintTo(std::ostream& os, PrintDimension dim) { |
| } else if (this->IsConstant()) { |
| os << "Constant(" << Brief(*this->AsConstant()->Value()) << ")"; |
| } else if (this->IsRange()) { |
| - os << "Range(" << this->AsRange()->Min()->Number() |
| - << ", " << this->AsRange()->Max()->Number() << ")"; |
| + std::ostream::fmtflags saved_flags = os.setf(std::ios::fixed); |
| + std::streamsize saved_precision = os.precision(0); |
| + os << "Range(" << std::fixed << std::setprecision(0) |
|
rossberg
2014/11/10 13:46:11
Why precision 0? And why has to be set twice?
|
| + << this->AsRange()->Min()->Number() << ", " |
| + << this->AsRange()->Max()->Number() << ")"; |
| + os.flags(saved_flags); |
| + os.precision(saved_precision); |
| } else if (this->IsContext()) { |
| os << "Context("; |
| this->AsContext()->Outer()->PrintTo(os, dim); |