Solved

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

Posted on 2013-06-27
2
657 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem!!! 8 33
VB.net and sql server 4 33
Obtain cell value using column ID in DataGrid using VB.NET 2 17
Sort GridView by ID Descending 1 9
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

785 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