Skip to content

Fix math precedence

James Willenbring requested to merge fix-math-precedence into develop

Created by: ibaned

@trilinos/teuchos

Description

Fix precedence of MathExpr operators

Fixed a couple of issues here:

  1. The expression "-x^2" was being interpreted as "(-x)^2", I think most people expected "-(x^2)"
  2. The expression "a^b^c" would have been interpreted as "(a^b)^c", whereas I think the expectation is "a^(b^c)".

Motivation and Context

Correctness of initial conditions used by internal Sandia applications

Edit: @bartlettroscoe it is fairly non-trivial to check this with a unit test without building on code that is part of the application and not part of Teuchos.

Merge request reports