Skip to content

priority of operators in math.parse() #3108

Answered by josdejong
meghna786 asked this question in Q&A
Discussion options

You must be logged in to vote

The precedence of multiplication and division in mathjs is hardcoded. If you want to change that, you can either:

  • clone the library and change the code of the parser, see parse.js.
  • write logic to adjust the parsed expression tree using the Node.transform method. See docs (search for "transform" on that page).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@meghna786
Comment options

Answer selected by meghna786
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants