解析数学防爆pression [英] Parse Math Expression

查看:117
本文介绍了解析数学防爆pression的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种简单的方法来分析psented作为一个字符串一个简单的数学EX pression重新$ P $如(X +(2 * X)/(1-X)),提供了对于x的值,得到的结果?

Is there an easy way to parse a simple math expression represented as a string such as (x+(2*x)/(1-x)), provide a value for x, and get a result?

我看着每几个网上例子VSAEngine,但是,我得到一个警告,本次大会已经去precated和不使用它。

I looked at the VSAEngine per several online examples, however, I am getting a warning that this assembly has been deprecated and not to use it.

如果这有什么差别,我使用.NET 4.0。

If it makes any differences, I am using .NET 4.0.

推荐答案

您可以尝试使用的 DataTable.Compute

一个相关的是的DataColumn。防爆pression

另外,请查阅:<一href="http://stackoverflow.com/questions/1452282/doing-math-in-vb-net-like-eval-in-javascript">http://stackoverflow.com/questions/1452282/doing-math-in-vb-net-like-eval-in-javascript

注:我还没有使用这些我自己

Note: I haven't used these myself.

这篇关于解析数学防爆pression的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆