# mXparser - Math Expression Evaluator / Parser - Library Description

mXparser is a super easy, rich, fast and highly flexible math expression parser library (parser and evaluator of mathematical expressions / formulas provided as plain text / string). Software delivers easy to use API for JAVA, Android and C# .NET/MONO (Common Language Specification compliant: F#, Visual Basic, C++/CLI). Expression parser comes with extensive documentation, easy to follow tutorial, "Hello World!" projects for 5 different languages explained with many screenshots, and finally - last, but not least - performance test summary. Formula evaluator is distributed under "Simplified BSD license", which means software is completely free 🙂

### C# Demo

*** If you found the software useful donation is something you might consider 🙂 ***

!!! mXparser - v.4.0.0 released on 2017-03-27: Major update: Bitwise Operators, Numbers in scientific notation, Units, Physical & Astronomical Constants, Equations solving via finding function root, Better tokens handling, Function Extensions - possibility of using your own implementation, Bugs fixed. !!!

## Few examples of string equivalent to the math formula notation:

$1+2$"1+2"

$1+\frac{2}{3} + (4\cdot 5-10)$"1+2/3+(4*5-10)"

$2x+\sin(y)$"2*x+sin(y)"

$\int_{-1}^{1}\sqrt{1-x^2}$ =  "int( sqrt(1-x^2), x, -1, 1)"

$\sum_{n=1}^{100}\frac{1}{n^2}$ = "sum(n, 1, 100, 1/n^2)"

$n\choose k$ = "C(n,k)"

$fib_n=\begin{cases}fib_{n-1}+fib_{n-2}\\fib_1=1\\fib_0=0\end{cases}$"fib(n) = iff( n>1, fib(n-1)+fib(n-2); n=1, 1; n=0, 0)"

## Math expressions parser - supported frameworks:

• JAVA: 1.5, 1.6, 1.7, 1.8 (separate binaries available if necessary)
• Android: tested with mxparser_jdk1.7.jar
• .NET/MONO: 2.0, 3.0, 3.5, 4.0, 4.5, 4.6 (separate binaries available if necessary)
• .NET Core: 1.0, 1.1
• .NET Standard: 1.0, 1.6
• .NET PCL: portable45, win8, wpa81
• Xamarin.Android: 1.0, 6.0
• Xamarin.iOS: 1.0

Did you find the software useful? Please consider donation 🙂
Developing and maintaining MathParser.org-mXparser takes a lot of time, mainly my free time. I hope it saved some of your time. If yes, then buy me a coffee 🙂

### Math Expressions Parser Features:

• rich built-in library of operators, constants, math functions;
• user defined: arguments, functions, recursive functions and general recursion (direct / indirect);
• grammar and internal syntax checking;

### Math Expressions Parser - features list with examples

Functionality Example Support level
Simple calculator i.e.: 2+3, n! Full support
Binary relations i.e.: a*b Full support
Boolean operators i.e.: a&b Full support
Built-in constants i.e.: 2+pi Full support
User defined constants i.e.: 3tau, where tau = 2pi Full support
Built-in unary functions i.e.: sin(2) Extensive collection
Built-in binary functions i.e.: log(a,b) Main functions
Built-in n-arguments functions i.e.: gcd(a,b,c,d,…) Special functions
Evaluating conditions i.e.: if(a=true, then b, else c) Full support
Cases functions i.e.: iff(case1, then a1, case2, then a2, ...) Full support
User defined arguments i.e.: x = 5, cos(x) Full support
User defined dependent arguments i.e.: x=2, y=x^2 Full support
Iterated operators - SIGMA summation i.e.: sum( 1, n, f(…,i) {step} ) Full support
Iterated operators - PI product i.e.: prod( 1, n, f(…,i) {step} ) Full support
Derivatives i.e.: der( sin(x), x) ) Full support
Integrals i.e.: 2*int( sqrt(1-x^2), x, -1, 1) Full support
User defined functions i.e.: f(x,y) = sin(x+y) Full support
Fast (limited) recursion i.e.: fib(n) = fib(n-1) + fib(n-2), addBaseCase(0, 0), addBaseCase(1, 1) Full support
Recursion, any kind i.e.: Cnk(n,k) = if( k>0, if( k<n, Cnk(n-1,k-1)+Cnk(n-1,k), 1), 1) Full support
Syntax checking checkSyntax() Full support
Getting computing time getComputingTime() Full support
Verbose mode setVerboseMode() Full support

### mXparser - deliverables

Language / Framework Documentation Library Source code
JAVA Yes Yes Yes
Android Yes Yes Yes
C# .NET Yes Yes Yes
Visual Basic .NET(CLS) Yes Yes
C++/CLI .NET(CLS) Yes Yes
F# .NET(CLS) Yes Yes
Other .NET languages Yes Yes, not tested
MONO Yes Yes, dll tested C# code

# Math Expression Parser - Project documentation

### - mXparser - SourceForge

*** If you found the software useful donation is something you might consider 🙂 ***

Best regards,