Skip to content

Unexpected precedence behavior in math parser (unary minus vs. power)

-2^2 evaluates to 4 (unary minus has higher precedence than binary power operator); I think this contrasts with usual conventions (I'd expect -2^2 to evaluate to -4). At any rate, precedence of arithmetic operators should be well documented.

Edited by Pierangelo Masarati
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information