viktorstrate / algebra-latex

Parse and calculate latex formatted math
https://www.npmjs.com/package/algebra-latex
MIT License
28 stars 9 forks source link

Exponent after bracket throws error #13

Closed leafthelegend closed 3 years ago

leafthelegend commented 3 years ago

When attempting to parse strings such as "(x)^2" or "(x+1)^2", an error is thrown: Screen Shot 2020-11-09 at 4 50 00 pm This may have something to do with the fact that I am using the package in the browser via Browserify, but I doubt it since everything else works smoothly. As far as I can tell, exponentiation should have the same syntax as multiplication or addition, just with a ^ in place of a *. Since the others work fine ("(x+1)*2" etc), hopefully this should be a simple fix.

viktorstrate commented 3 years ago

Hi @leafthelegend

This is a bug, thank you for reporting it. I'll work on a fix probably later today.

viktorstrate commented 3 years ago

This is fixed in v2.0.2

leafthelegend commented 3 years ago

It seems like I'm still experiencing the bug in v2.0.2. For example running the latest version in RunKit: Screen Shot 2020-11-10 at 8 55 12 pm

viktorstrate commented 3 years ago

Okay, it apparently didn't push the updates correctly in v2.0.2. I've pushed the update properly in v2.0.3.