Solved

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

Posted on 2013-06-27
2
654 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
ID: 39282045
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
ID: 39282286
The second one seems to fit what I am looking for more closely.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

920 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

12 Experts available now in Live!

Get 1:1 Help Now