运行时数学公式 [英] Runtime mathematical Formulla

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

问题描述

HI,

我想使用C#构建运行时数学公式
例如:x_(y ^ 2)

你能帮我吗?

谢谢与问候
Vijay.S



i want to build Runtime mathematical formulla using c#

Eg:x_(y^2 )

can you please help me..

Thanks & Regards
Vijay.S

推荐答案

做到这一点的明显方法是解析代码并确定操作内容,然后应用它们.我以为这是做作业,所以我以为那是他们想要你做的.

如果是用于现实世界的任务,则可以编写代码来执行键入的文本. System.CodeDom是具有所需方法的命名空间.
The obvious way to do this is to parse the code and work out what the operations are, then apply them. I assume this is for homework, so I assume that''s what they want you to do.

If it''s for a real world task, you can write code that executes the text you type in, as code. System.CodeDom is the namespace that has the methods you need.



您应该阅读 CodeDom计算器-动态评估C#数学表达式 [
Hi,
You should read CodeDom Calculator - Evaluating C# Math Expressions Dynamically[^].
This will help you a lot.


--Amit


查找以下链接, [ ^ ]

会很有帮助
Find the following link, [^]

It will be helpful


这篇关于运行时数学公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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