Evaluate math expression in string? (NSString)

Possible duplicate:
What is a fast C or Objective-C math analyzer?

I have an NSString which is a computation for example. @"(10+10)*2"

and I want to evaluate the string as if it were something like this:

double result = (10+10)*2;

      

What's the easiest approach for iOS?

+3
c math ios objective-c


source to share


2 answers


Take a look at Dave DeLong's DDMathParser framework .



+4


source to share


You can use GCMathParser .



+2


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics