Converting Textbox.Text that contains Math Formula to a Math Formule and Use Input Arguments for the Functions.

Hi dear Experts,

I have a serious problem and I need Urgent Answer .

I have a textbox that my user enters an C# Math formula like " Math.Cos(x) + 2 * x "
I need to have this text as a math function and pass the "x" argument to the formule in my function :

public double functionresult(double x1, string functions )
            double x = x1 ; // this is my Argument
            // I need to get that Textbox math Functions and return the whole expression's answer.

please help me in this case ...

Who is Participating?
Fahad MukhtarDistinguished EngineerCommented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.