python wrapper for tinyexpr
tinex.eval(expression, **variables) → float¶Evaluate an expression
| Parameters: |
|
|---|---|
| Returns: | result – The result of evaluation. |
| Return type: | |
| Raises: |
|
Examples
>>> import tinex as te
>>> te.eval('sqrt(a^2+b^2)', a=3, b=4)
5.0
>>> te.eval('cos(pi)')
-1.0
>>> te.eval('-5/0')
-inf
tinex.Expression¶a compiled expression
| Parameters: |
|---|
Example
>>> Expression('(sin(42) * alpha) / (beta + 45^3)',
... varnames='beta alpha')
<Expression: (sin(42) * alpha) / (beta + 45^3)>
Todo