Skip to content

How to mark expression to skip or use variable names? #9

@DktPhl2019

Description

@DktPhl2019

Hello

For example, I have math expression: 21+5*(e^(-1))+log(8)-9-(2^3)/6

exp = Expression("21+5*(e^(-1))+log(8)-9+(2^3)/6").eval().toString();

I know the following:

a = 21
b = 5*(e^(-1))
c = log(8)-9
d = (2^3)/6

Ideally, I want to evaluate the expression using variable names: a+b+c-d

exp = Expression(a+b+c-d).eval().toString();

I know it is not currently possible to use variables in eval expression.

I wonder if I somehow skip symbols like this: 'a:'+21+'b:'+5*(e^(-1))+'c:'+log(8)-9+'d:'+(2^3)/6

Could you please let me know your thoughts.

Thank You

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions