diff options
author | Teddy <[email protected]> | 2013-08-09 21:47:28 +0800 |
---|---|---|
committer | Teddy <[email protected]> | 2013-08-09 21:47:28 +0800 |
commit | 155c3e5d46909d36d9f595e2a3b8d786240b9520 (patch) | |
tree | c3adf4c128dfa3abe00efc40453d38e62f4d5207 | |
parent | ed541c0d83caff9e417a89bc4e6ae83ea22eb214 (diff) |
add proper precision to ext repr of real numbers
-rw-r--r-- | builtin.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin.cpp b/builtin.cpp index a8091ba..98090e0 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -6,6 +6,7 @@ #include <sstream> #include <cctype> #include <cstdlib> +#include <iomanip> 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(); } |