W
wannabe geek
I need a way to successfully parse a string expression and return a number.
Some examples:
"1+1" = 2
"3+4*2" = 11
"(11*(8-3))/5" = 11
"X*2" = X*2
"If((1=1)=True,1,2)" = 1
"Sum(X,3,5)+Max(1,2,3)" = X+11
I am thinking about creating a function plotter and the user must be able to
create complex functions. I need to be able to use 'X' as a parameter. I also
need the ablility to use any number of custom functions. I will probably be
using only boolean and numeric (double perhaps?) values. I can foresee no
need for comments. Could somebody guide me to a webpage that is
straightforward and easy to follow? I would appreciate something quite
efficient since this will be iterating quite a few times.
Some examples:
"1+1" = 2
"3+4*2" = 11
"(11*(8-3))/5" = 11
"X*2" = X*2
"If((1=1)=True,1,2)" = 1
"Sum(X,3,5)+Max(1,2,3)" = X+11
I am thinking about creating a function plotter and the user must be able to
create complex functions. I need to be able to use 'X' as a parameter. I also
need the ablility to use any number of custom functions. I will probably be
using only boolean and numeric (double perhaps?) values. I can foresee no
need for comments. Could somebody guide me to a webpage that is
straightforward and easy to follow? I would appreciate something quite
efficient since this will be iterating quite a few times.