• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 676
  • Last Modified:

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

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.
1 Solution
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.
NevSoFlyAuthor Commented:
The second one seems to fit what I am looking for more closely.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now