Made printing of special FP values portable.

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/386973003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22354 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d0e1daf3
......@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <algorithm>
#include <cmath>
#include "src/ostreams.h"
......@@ -63,6 +64,8 @@ OStream& OStream::operator<<(unsigned long long x) { // NOLINT(runtime/int)
OStream& OStream::operator<<(double x) {
if (std::isinf(x)) return *this << (x < 0 ? "-inf" : "inf");
if (std::isnan(x)) return *this << "nan";
return print("%g", x);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment