Solved

Performing math operations on algebraic variables in .net (vb or c#)

Posted on 2013-06-27
2
653 Views
Last Modified: 2013-06-27
Is there anyway (and if so how?) of performing math operations on algebraic variables in .net?
for example:

   Dim a as integer
   Dim x as integer

   x = a + a

Would result in x= 0 because no value was ever given to a.  What I am looking for is a way for x to equal 2a (x = 2a).  If anyone has any sample code or advice.  It would be greatly welcomed.

I mostly work in VB.net but could covert C#.  Even C++ might help.
0
Comment
Question by:NevSoFly
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
Comment Utility
Are you thinking along the lines of http://www.codeproject.com/Articles/24125/Parsing-Algebraic-Expressions-Using-the-Interprete ("Parsing Algebraic Expressions Using the Interpreter Pattern") or http://www.codeproject.com/Articles/118728/Creating-A-Math-Library-With-Algebra-Functions ("Creating A Math Library With Algebra Functions")? Both will allow you to parse and evaluate equations.
0
 

Author Closing Comment

by:NevSoFly
Comment Utility
The second one seems to fit what I am looking for more closely.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now