diff options
| author | 2018-09-28 10:28:24 +0200 | |
|---|---|---|
| committer | 2018-09-28 10:28:24 +0200 | |
| commit | 8bb4e7a3befc6ce549b631d8a83b9ba69ed73b7a (patch) | |
| tree | 2467c46f22424fadb36fdb9470f4adaaaa6f8da8 /node | |
| parent | 49567f95bf6985707fcf8c2836c761ce39602636 (diff) | |
| download | OneRoll-8bb4e7a3befc6ce549b631d8a83b9ba69ed73b7a.tar.gz OneRoll-8bb4e7a3befc6ce549b631d8a83b9ba69ed73b7a.zip | |
add integer division operator
Diffstat (limited to 'node')
| -rw-r--r-- | node/scalaroperatornode.cpp | 6 |
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; |