TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ahmed
NA
2
0
How to work with Power equation and expression in C#
Sep 26 2007 7:55 AM
all i want code when user
write any equations like this "(x^2+x)/(x*x)"
in text box 1
and write the value "x" in text box 2 , he has the value of this equation in message box when he press ok.
please, help me to get this code
and thank u .
and my problem , How can i write power expression in this code:
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(Evaluate(textBox1.Text.Replace("x",textBox2.Text)).ToString());
}
public static double Evaluate(string expression)
{
return (double)new System.Xml.XPath.XPathDocument
(new StringReader("<r/>")).CreateNavigator().Evaluate
(string.Format("number({0})", new
System.Text.RegularExpressions.Regex(@"([\+\-])")
.Replace(expression, " ${1} ")
.Replace("/", " div ")
Reply
Answers (
1
)
XSD in C#
Help .please