diff options
| author | 2015-04-25 11:43:06 +0200 | |
|---|---|---|
| committer | 2015-04-25 11:43:06 +0200 | |
| commit | 942cf3f75f49d83c4e512d5350f7de69f0ec8aa7 (patch) | |
| tree | dc1bc3470ee90a7950747e0d1d25e4e66a0218c0 /node/scalaroperatornode.cpp | |
| parent | 8beb664172cf2c15abb4e12938b8978506471c02 (diff) | |
| parent | 74275e3e17b7f8e9409d86382aa355c36e7005bd (diff) | |
| download | OneRoll-942cf3f75f49d83c4e512d5350f7de69f0ec8aa7.tar.gz OneRoll-942cf3f75f49d83c4e512d5350f7de69f0ec8aa7.zip | |
Merge branch 'master' of github.com:obiwankennedy/DiceParser
Diffstat (limited to 'node/scalaroperatornode.cpp')
| -rw-r--r-- | node/scalaroperatornode.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/node/scalaroperatornode.cpp b/node/scalaroperatornode.cpp index 34eb6b8..8dfbc20 100644 --- a/node/scalaroperatornode.cpp +++ b/node/scalaroperatornode.cpp @@ -105,6 +105,11 @@ qint64 ScalarOperatorNode::substract(qint64 a,qint64 b) qreal ScalarOperatorNode::divide(qint64 a,qint64 b) { + if(b==0) + { + m_errors.append(DIVIDE_BY_ZERO); + return 0; + } return (qreal)a/b; } |