augustt198 / latex2sympy

Parse LaTeX math expressions
MIT License
386 stars 162 forks source link

Incorrect parsing of negative numbers #34

Open ducminh-phan opened 7 years ago

ducminh-phan commented 7 years ago

process_sympy("(-1) * 2") and process_sympy("-2") return the same result Mul(-1, 2). process_sympy("-2") should return -2 instead of Mul(-1, 2).

process_sympy("-2/3") returns Mul(Mul(-1, 2), Pow(3, -1)) instead of Rational(-2, 3).