From e0534ee78138a12464d3c37b51678291778d6a51 Mon Sep 17 00:00:00 2001 From: Giles Bathgate Date: Sat, 5 Feb 2011 19:02:50 +0000 Subject: Dump number values with correct precision. You might want to apply this patch so that the output of echo($pi) is not truncated. diff --git a/src/value.cc b/src/value.cc index 92aaff1..b5c4afe 100644 --- a/src/value.cc +++ b/src/value.cc @@ -324,6 +324,7 @@ void Value::reset_undef() std::string Value::toString() const { std::stringstream stream; + stream.precision(16); switch (this->type) { case STRING: @@ -338,9 +339,13 @@ std::string Value::toString() const stream << ']'; break; case RANGE: - stream << "[ " - << this->range_begin << " : " << this->range_step << " : " << this->range_end - << " ]"; + stream << "[ " + << this->range_begin + << " : " + << this->range_step + << " : " + << this->range_end + << " ]"; break; case NUMBER: stream << this->num; -- cgit v0.10.1