pieterderycke / Jace

Jace.NET is a calculation engine for the .NET platform.
MIT License
436 stars 94 forks source link

Unary minus precedence #33

Closed abdolsamad closed 5 years ago

abdolsamad commented 6 years ago

Unary minus has higher precedence than power operator: var result = engine.Calculate("-1^2"); The result must become -1 but becomes +1 instead.

pieterderycke commented 5 years ago

I have done some research on the topic, but there does not seem to be an international accepted standard on the precedence of unary minus versus power. So I recommend to use brackets ()