diff options
author | bajb <brooke@bajb.net> | 2016-04-01 16:52:34 +0300 |
---|---|---|
committer | bajb <brooke@bajb.net> | 2016-04-01 16:52:34 +0300 |
commit | 9acdc3bb5736f876c69dec51380580a4aadef201 (patch) | |
tree | c60152b65e278d4caa4750d4763567021d35a612 /src/NXP/Classes/Token | |
parent | 5d19d0660c395cf500c01c9f3f1e451f6914080b (diff) |
Specifically check for 0 in division to allow for negative operations
Diffstat (limited to 'src/NXP/Classes/Token')
-rw-r--r-- | src/NXP/Classes/Token/TokenDivision.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/NXP/Classes/Token/TokenDivision.php b/src/NXP/Classes/Token/TokenDivision.php index 7e55640..f1c35ff 100644 --- a/src/NXP/Classes/Token/TokenDivision.php +++ b/src/NXP/Classes/Token/TokenDivision.php @@ -47,7 +47,7 @@ class TokenDivision extends AbstractOperator { $op2 = array_pop($stack); $op1 = array_pop($stack); - $result = $op2->getValue() > 0 ? $op1->getValue() / $op2->getValue() : 0; + $result = $op2->getValue() != 0 ? $op1->getValue() / $op2->getValue() : 0; return new TokenNumber($result); } |