Click here to Skip to main content
15,902,276 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI,

i want to build Runtime mathematical formulla using c#

Eg:x_(y^2 )

can you please help me..

Thanks & Regards
Vijay.S
Posted

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.
 
Share this answer
 
Hi,
You should read CodeDom Calculator - Evaluating C# Math Expressions Dynamically[^].
This will help you a lot.


--Amit
 
Share this answer
 
Find the following link, [^]

It will be helpful
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900