?
Solved

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

Posted on 2013-06-27
2
Medium Priority
?
668 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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 goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

801 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