Another not-easy question...

geonaf

Freshman
Joined
Jan 28, 2003
Messages
29
Is the following possible in vb net?:
The user types in a mathematical expression for X and the program calculates it for x=1,eg:

Input: x^2+E^x
Output: 3.71828


Please help me!!!
 
I don't believe there is any easy, built in way (I could be wrong). I
looked into possibly using the Debug window to evaluate expressions,
but I couldn't see any way to do it by code. However, it may be
worth further investigation.

You could look online for an expression evaluator, or search the MSDN
to see if I am indeed incorrent; there could be a built in one, I'm not
sure.
 
It is possible.

You will need to parse the entire string looking for any operator and all the numbers which surround them. Perhaps place them into an array from a Regular Expression (split)
 
As a side note, the immediate window can handle equations like that I think.

[edit]Perhaps not.[/edit]
 
Back
Top