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
0 answers

Downcasting error in Swift 4 bridging class, which did not occur in Swift 3

Using a swift class to bridge between MathParser swift framework and an objective-c project, the @objc public func evaluateString(string: String, substitutions:Substitutions = [:]) throws -> NSNumber compiled without problems using Swift 3, yet…
swainwri
  • 66
  • 7
0
votes
1 answer

DDMathParser: Parsing dynamic formula which contain $ to refer objects value within dictionary

I am struggling a little bit to use DDMathParser framework for expression requirement I have. I have JSON of fields & based on expressions certain fields can be set required, hidden or set the value of it. Expressions in required tag in sample JSON…
Ameer
  • 705
  • 8
  • 18
0
votes
1 answer

DDMathParser 3.0.0 with CocoaPods

Hey there and Merry Xmas, I would like to add the DDMathParser to my Swift 3 project using the latest CocoaPods version. The problem is I only get DDMathParser 2.0.0 installed. What do I miss? my podfile is: platform :osx, '10.11' target 'DDTest02'…
JFS
  • 2,992
  • 3
  • 37
  • 48
0
votes
1 answer

Define custom functions in DDMathParser (Swift)

I am attempting to define and format a custom function in Swift via the mechanisms built into DDMathParser. I have tried following the instructions on the Wiki, but for someone who is relatively new to Swift coding there are not enough specifics.…
0
votes
1 answer

DDMathParser not working in Obj-C project using CocoaPods

I have an Obj-C project with CocoaPods. Now I need to use DDMathParser, written in Swift. But can not import DDMathParser correctly. When I add new Swift file to the project, it works fine. DDMathParser is not working even in swift file I've…
Rost
  • 265
  • 1
  • 11
0
votes
0 answers

Framework not working in iOS 8

I am using DDMathParser in my project. I have set the deployment target to iOS 8.0 of my project. My project is running fine on iOS 9 emulator but not my iPhone which is running iOS 8.4. The documentation of library shows that it is supported on iOS…
Bilal
  • 558
  • 8
  • 18
0
votes
2 answers

How do i set the % mode switch in DDMathParser

I am trying to use the DDMathParser in my application, and am having difficulty in getting it to work with % symbol as percent, instead of modulo. The wiki advises the following - The % sign is usually interpreted as the modulo operator. However,…
superllanboy
  • 607
  • 2
  • 6
  • 18
0
votes
1 answer

DDMathParser - Getting tokens

I'm looking to get tokens back from a string (to aid in editing) and referring to the answer here iOS DDMathParser Get Number 'Blocks' it appears that this functionality may be deprecated. What is the most up-to-date way to get token objects from my…
joshd
  • 1,626
  • 14
  • 17
0
votes
1 answer

Using DDMathParser to solve string in swift

I want to pass a string to DDMathParser and store answer in another string variable using swift. I am totally new to iOS platform so I dont really know syntax of functions. Example: var expr = "5+9*2" //Some Expression var result =…
Bilal
  • 558
  • 8
  • 18
0
votes
1 answer

sin(pi()) does not return 0 in DDMathParser

I'm making a calculator app using DDMathParser. The problem I'm facing is sin(pi()) doesn't return 0 but a trivial number like 1.2246...e-16. I'm just wondering is there any way to convert it to 0? Thank you.
user
  • 85
  • 3
  • 13
0
votes
2 answers

`resolve_dtor() `Parentheses Algorithm

I'm running into a frustrating problem with a parentheses completion algorithm. The math library I'm using, DDMathParser, only processes trigonometric functions in radians. If one wishes to use degrees, they must call dtor(deg_value). The problem is…
Biff
  • 1,009
  • 3
  • 11
  • 20
0
votes
2 answers

DDMathParser & iOS7/XCode Compatibility

I added DDMathParser as a submodule in my Git repository, and after running it, the code only seems to work with OS X. Right away it gives me the following error in DemoController.h, etc.: 'Cocoa/Cocoa.h' file not found Can DDMathParser work with a…
Biff
  • 1,009
  • 3
  • 11
  • 20
0
votes
1 answer

Can't solve the mathematical expression using DDMathParser

I am using DDMathParser to parse the string expressions. I am working on one expression which is "(2+x)6+2x+2y=5y+2x", I am trying to parse it and evaluate it using DDMathParser. It can be considered as first degree function that I need to solve…
Kuldeep
  • 2,589
  • 1
  • 18
  • 28
0
votes
0 answers

how to calculate absolute values , first/second degree equations, derivative and integration using DDMathParser

i am developing a calculator for iPad . I would like to ask you if there is a way for DDMathParser to calculate absolute values , e.g (2+4*5)/88 should give 1/4 and not 0.25 . Is it possible to have two modes absolute and exact(decimal)? I would…
user1480179
  • 169
  • 1
  • 7
0
votes
1 answer

DDMathParser: nil value

Sorry for my english, I try to explain better my problem: I need to parse a math expression and then save the results inside a variable, this is my code: for (i = -100; i < 100; i = i + step) { NSError *error = nil; NSDictionary…
francesco.venica
  • 1,703
  • 2
  • 19
  • 54