We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
console.log(JSON.stringify(math.parse('4/3x')));
results in
{"mathjs":"OperatorNode","op":"*","fn":"multiply","args":[{"mathjs":"OperatorNode","op":"/","fn":"divide","args":[{"mathjs":"ConstantNode","value":4},{"mathjs":"ConstantNode","value":3}],"implicit":false},{"mathjs":"SymbolNode","name":"x"}],"implicit":true}
console.log(JSON.stringify(math.parse('+4/3x'))); console.log(JSON.stringify(math.parse('-4/3x')));
{"mathjs":"OperatorNode","op":"/","fn":"divide","args":[{"mathjs":"OperatorNode","op":"+","fn":"unaryPlus","args":[{"mathjs":"ConstantNode","value":4}],"implicit":false},{"mathjs":"OperatorNode","op":"*","fn":"multiply","args":[{"mathjs":"ConstantNode","value":3},{"mathjs":"SymbolNode","name":"x"}],"implicit":true}],"implicit":false}
{"mathjs":"OperatorNode","op":"/","fn":"divide","args":[{"mathjs":"OperatorNode","op":"-","fn":"unaryMinus","args":[{"mathjs":"ConstantNode","value":4}],"implicit":false},{"mathjs":"OperatorNode","op":"*","fn":"multiply","args":[{"mathjs":"ConstantNode","value":3},{"mathjs":"SymbolNode","name":"x"}],"implicit":true}],"implicit":false}
the first expression was parsed as (4/3)x
(4/3)x
the next expressions were parsed as 4/(3x) and -4/(3x)
4/(3x)
-4/(3x)
Why do the unary operators make the differences
The text was updated successfully, but these errors were encountered:
This is a known bug in the parser, see #1431.
Sorry, something went wrong.
Let's continue any discussion in #1431. Any help solving the issue is very welcome.
No branches or pull requests
results in
{"mathjs":"OperatorNode","op":"*","fn":"multiply","args":[{"mathjs":"OperatorNode","op":"/","fn":"divide","args":[{"mathjs":"ConstantNode","value":4},{"mathjs":"ConstantNode","value":3}],"implicit":false},{"mathjs":"SymbolNode","name":"x"}],"implicit":true}
results in
{"mathjs":"OperatorNode","op":"/","fn":"divide","args":[{"mathjs":"OperatorNode","op":"+","fn":"unaryPlus","args":[{"mathjs":"ConstantNode","value":4}],"implicit":false},{"mathjs":"OperatorNode","op":"*","fn":"multiply","args":[{"mathjs":"ConstantNode","value":3},{"mathjs":"SymbolNode","name":"x"}],"implicit":true}],"implicit":false}
{"mathjs":"OperatorNode","op":"/","fn":"divide","args":[{"mathjs":"OperatorNode","op":"-","fn":"unaryMinus","args":[{"mathjs":"ConstantNode","value":4}],"implicit":false},{"mathjs":"OperatorNode","op":"*","fn":"multiply","args":[{"mathjs":"ConstantNode","value":3},{"mathjs":"SymbolNode","name":"x"}],"implicit":true}],"implicit":false}
the first expression was parsed as
(4/3)x
the next expressions were parsed as
4/(3x)
and-4/(3x)
Why do the unary operators make the differences
The text was updated successfully, but these errors were encountered: