Skip to content

Commit

Permalink
Formula engine: fix exponentiation being left-associative
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Mar 18, 2016
1 parent 0b84677 commit a446921
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/formula.cpp
Expand Up @@ -888,7 +888,9 @@ expression_ptr parse_expression(const token* i1, const token* i2, function_symbo
} else if(parens == 0 && i->type == TOKEN_OPERATOR) {
if( ( !operator_group ) && (op == NULL || operator_precedence(*op) >=
operator_precedence(*i)) ) {
op = i;
// Need special exception for exponentiation to be right-associative
if(*i->begin != '^' || op == NULL || *op->begin != '^')
op = i;
}
operator_group = true;
} else {
Expand Down

0 comments on commit a446921

Please sign in to comment.