MATHS EVALUATOR

  • Thread starter Thread starter Pascal
  • Start date Start date
P

Pascal

hi

I TRY to find easy to use evaluator of string like this (4*100)+(0.2*5)
where the answer is 401. I tried several from codeproject (mcalc and other
but without sucess). Does someone know a place where i can find this ?
the operator are always + - * / no more functions are needed.

thanks for help
pascal

http://www.scalpa.info
 
Pascal said:
I TRY to find easy to use evaluator of string like this (4*100)+(0.2*5)
where the answer is 401. I tried several from codeproject (mcalc and other
but without sucess). Does someone know a place where i can find this ?
the operator are always + - * / no more functions are needed.


IMO, MTParser - by Mathieu Jacques - is the best:

http://www.codeproject.com/cpp/MathieuMathParser.asp


However, it does much more than you require.

Marco / iw2nzm
 
Whoah it seems to be good !!! But Can I use it under vb 2005 express ! I
tried to add a reference to MTParserCOM.dll and i get an error message the
first time and when i tried again it worked..... Now every thing goes
right..... Thanks a lot for this link !!!
pascal
 
Pascal said:
I TRY to find easy to use evaluator of string like this
(4*100)+(0.2*5) where the answer is 401. I tried several from
codeproject (mcalc and other but without sucess). Does someone know a
place where i can find this ? the operator are always + - * / no
more functions are needed.

If you want to write it yourself, the algorithm is described in
http://en.wikipedia.org/wiki/Shunting_yard_algorithm

Andrew
 
hi Andrew
thanks for the link, it's interesting but i am not able to deal with the
code...
pascal
 
Back
Top