From 6db003f22eef964bca90104902b7597c57ddaa81 Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Sat, 10 Mar 2012 20:38:44 +0100 Subject: Enabled full precision output of results --- main.cpp | 6 +++++- tree.cpp | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 96735da..5044f18 100644 --- a/main.cpp +++ b/main.cpp @@ -1,4 +1,5 @@ #include +#include #include "parser.h" int main(int argc, char *argv[]) @@ -10,7 +11,10 @@ int main(int argc, char *argv[]) Parser *parser = new Parser(); try { - std::cout << parser->calculate(inputTerm, true).result << std::endl; + typedef std::numeric_limits dbl; + std::cout.precision(dbl::digits10); + + std::cout << parser->calculate(inputTerm, false).result << std::endl; } catch ( exception &e ) { diff --git a/tree.cpp b/tree.cpp index 340685f..0ef3a39 100644 --- a/tree.cpp +++ b/tree.cpp @@ -1,4 +1,5 @@ #include "tree.h" +#include Node::Node() { @@ -103,6 +104,9 @@ Node* Tree::addOperator(Node **place, char oper) string Tree::print(string term) { std::stringstream out; + + typedef std::numeric_limits dbl; + out.precision(dbl::digits10); out << "digraph \"" << term << "\"" << endl << "{" << endl << "node [shape = box];" << endl; -- cgit v1.2.3