aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2018-09-28 10:28:24 +0200
committerRenaud G <renaud@rolisteam.org>2018-09-28 10:28:24 +0200
commit8bb4e7a3befc6ce549b631d8a83b9ba69ed73b7a (patch)
tree2467c46f22424fadb36fdb9470f4adaaaa6f8da8 /node
parent49567f95bf6985707fcf8c2836c761ce39602636 (diff)
downloadOneRoll-8bb4e7a3befc6ce549b631d8a83b9ba69ed73b7a.tar.gz
OneRoll-8bb4e7a3befc6ce549b631d8a83b9ba69ed73b7a.zip
add integer division operator
Diffstat (limited to 'node')
-rw-r--r--node/scalaroperatornode.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/node/scalaroperatornode.cpp b/node/scalaroperatornode.cpp
index edc769d..4e24f2f 100644
--- a/node/scalaroperatornode.cpp
+++ b/node/scalaroperatornode.cpp
@@ -81,6 +81,9 @@ void ScalarOperatorNode::run(ExecutionNode* previous)
case Die::DIVIDE:
m_scalarResult->setValue(divide(previousResult->getResult(Result::SCALAR).toReal(),internalResult->getResult(Result::SCALAR).toReal()));
break;
+ case Die::INTEGER_DIVIDE:
+ m_scalarResult->setValue(static_cast<int>(divide(previousResult->getResult(Result::SCALAR).toReal(),internalResult->getResult(Result::SCALAR).toReal())));
+ break;
case Die::POW:
m_scalarResult->setValue(pow(previousResult->getResult(Result::SCALAR).toReal(),internalResult->getResult(Result::SCALAR).toReal()));
break;
@@ -162,6 +165,9 @@ QString ScalarOperatorNode::toString(bool wl) const
case Die::DIVIDE:
op="/";
break;
+ case Die::INTEGER_DIVIDE:
+ op="|";
+ break;
case Die::POW:
op="^";
break;