summaryrefslogtreecommitdiff
path: root/src/product.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/product.cpp')
-rw-r--r--src/product.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/product.cpp b/src/product.cpp
new file mode 100644
index 0000000..093aff1
--- /dev/null
+++ b/src/product.cpp
@@ -0,0 +1,11 @@
+#include "include/product.hpp"
+#include "include/syntax_tree.hpp"
+
+
+Product::Product(SyntaxTree *left, SyntaxTree *right)
+ : SyntaxTree{left, right}
+{}
+
+float Product::eval() const {
+ return left->eval() * right->eval();
+}