From 155c3e5d46909d36d9f595e2a3b8d786240b9520 Mon Sep 17 00:00:00 2001 From: Teddy Date: Fri, 9 Aug 2013 21:47:28 +0800 Subject: add proper precision to ext repr of real numbers --- builtin.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'builtin.cpp') diff --git a/builtin.cpp b/builtin.cpp index a8091ba..98090e0 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -6,6 +6,7 @@ #include #include #include +#include using std::stringstream; @@ -34,6 +35,7 @@ static const int NUM_LVL_INT = 3; string double_to_str(double val, bool force_sign = false) { stringstream ss; if (force_sign) ss << std::showpos; + ss << std::setprecision(16); ss << val; return ss.str(); } -- cgit v1.2.3