baldingwizard / Blender-Addons

119 stars 20 forks source link

Maths Expression operator precedence #7

Closed baldingwizard closed 5 years ago

baldingwizard commented 5 years ago

Spotted a problem with the mathematical precedence of * and / and + and -. For now can work around it by adding brackets to explicitly specify the correct precedence.

baldingwizard commented 5 years ago

Spotted the problem - fix on the way.

baldingwizard commented 5 years ago

Amended expression parsing to process from the end of the expression for +,-,*,/ operations. This means that the implied sequence matches the required precedence for '/' and '-' operations. eg, '5/a/b/c' becomes '((5/a)/b)/c' instead of '5/(a/(b/c))' (which would be wrong).