adletec / sonic

sonic is a rapid evaluation engine for mathematical expressions. It can parse and execute strings containing mathematical expressions.
MIT License
17 stars 4 forks source link

Negative exponent bug #49

Closed FabianNitsche closed 10 months ago

FabianNitsche commented 10 months ago

Sonic evaluates the expression 2*10^-2 to -2048 while it should be 0.02 This is because the AST builder interprets it as 2^10*-2 This is due to wrong precedence. I will provide a fix.

vlow commented 10 months ago

Hi Fabian, thanks for the find & the fix.

vlow commented 10 months ago

Published in 1.5.0.

FabianNitsche commented 10 months ago

Thank you for this very fast publish!