aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.cpp6
-rw-r--r--tree.cpp4
2 files changed, 9 insertions, 1 deletions
diff --git a/main.cpp b/main.cpp
index 96735da..5044f18 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,4 +1,5 @@
#include <iostream>
+#include <limits>
#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<double> 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 <limits>
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<double> dbl;
+ out.precision(dbl::digits10);
out << "digraph \"" << term << "\"" << endl << "{" << endl << "node [shape = box];" << endl;