axiacore / py-expression-eval

MIT License
149 stars 54 forks source link

Substitute with scientific notation #28

Open LucasAlegre opened 7 years ago

LucasAlegre commented 7 years ago

The following lines:

p = Parser() x = 0.00000002 p.parse('2*x').substitute('x', x)

Give this error: File "/usr/local/lib/python3.5/dist-packages/py_expression_eval/init.py", line 87, in substitute expr = Parser().parse(str(expr)) File "/usr/local/lib/python3.5/dist-packages/py_expression_eval/init.py", line 610, in parse self.error_parsing(self.pos, 'unexpected variable') File "/usr/local/lib/python3.5/dist-packages/py_expression_eval/init.py", line 639, in error_parsing raise Exception(self.errormsg) Exception: parse error [column 2]: unexpected variable