Questions tagged [ddmathparser]

An Objective-C framework for parsing mathematical expressions.

DDMathParser is an Objective-C framework by Dave DeLong for parsing mathematical expressions input by the user. This supports various mathematical expressions. The code is available on GitHub.

Source: DDMathParser Wiki

37 questions
0
votes
1 answer

Adding nCr Function to DDMathParser (with variable parameters)

I'm struggling to add a new function (nCr) to DDMathParser. I've tried to follow these instructions by the author of DDMathParser: https://stackoverflow.com/a/15599814/2521277 My problem: I can't manage to combine DDExpressions to a complex…
0
votes
1 answer

DDMathParser - Using a string as an argument in a custom function

I would like to make a function which would allow me to pass a string in the argument - what's the best way to do this? eg.. Moles("Ca(OH)2") Any help would be extremely gratefully received.
Chris
  • 2,727
  • 2
  • 27
  • 28
0
votes
1 answer

No visible @interface for 'DDExpression' declares the selector 'evaluateWithSubstitutions:error:' error

I have an array which I want to validate: {"2","+","3","=","5"} So how would I do it? I found DDMathParser and theoretically I would be able to validate my expression like so: NSString *expression = [array componentsJoinedByString:@""]; NSError…
Vad
  • 3,658
  • 8
  • 46
  • 81
0
votes
1 answer

DDMathParser gives memory leak

I am using DDMathParser in my Xcode project. I have a memory leak and I can't resolve it. Instruments gives me following leaked objects: _DDNumberExpression _DDFunctionExpression Can anyone help me? My code for using ddmathparser: NSString…
0
votes
1 answer

Linking error using DDMathParser (iOS 5, Xcode 4.2)

I try to add DDMathParser library to my project, but i get two linking errors. I'm a newbie in Objective-C programming, and it's still tricky for me. Below there is a snapshot of the errors i get: What should i do? I also tried CGMathParser but i…
-1
votes
2 answers

Solving math using DDMathParser in Objective-C

I'd like to use DDMathParser to solve a math problem. The top answer on this StackOverflow question shows how, but it only solves it to the log. I'd like to get the answer as a string on an integer. The code NSLog(@"%@", [math…
JustMe
  • 306
  • 1
  • 4
  • 15
-1
votes
1 answer

Why does NSMutablearray keep returning null?

I am generating a random equation say like 2*3+4..... and using DDMathparser to evaluate it. Here I have a class method which is supposed to return a random equation(stored inside a mutable array) only if it evaluates to a integer. however it keeps…
1 2
3