Skip to content

Commit 6ab5dbb

Browse files
committed
Fix for integer division of non-constants
1 parent e33697f commit 6ab5dbb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Expression.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ class ExpressionOp : public Expression {
103103
}
104104
else {
105105
if (left && right) {
106+
if (op == Operator::DIV) {
107+
output << "Math.floor";
108+
}
106109
output << '(';
107110
left->emit();
108111
output << ' ' << valid_ops.at(op).first << ' ';

0 commit comments

Comments
 (0)