How can I evaluate a math expression represented by a string?

后端 未结 6 2081
梦谈多话
梦谈多话 2021-01-06 15:56

It\'s easy to implement a \"Calculator\" to parse a string (e.g., 2 ^ 3 / 2) and compute the result of operations. But, is there a library already capable of d

6条回答
  •  南笙
    南笙 (楼主)
    2021-01-06 16:10

    embed ironpython in your app, you can then ask it to evaluate arbitrarily complex strings

    i think they even have a sample of the same thing

提交回复
热议问题