GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Main page
  • Contents
  • Current events
  • Random article
  • About Wikipedia
  • Contact us
  • Help
  • Learn to edit
  • Community portal
  • Recent changes
  • Upload file
  • Special pages
  • Search
  • Donate

This view

  • Original page
  • New address

GeezerVison is showing en.wikipedia.org — mXparser - Wikipedia

mXparser
Original authorMariusz Gromada
ReleaseJanuary 2010 (2010-01)
Stable release
6.1.1 / 17 May 2026 (2026-05-17)
Written inJava, C#, C++
PlatformJVM, Android, C++, .NET, .NET Core, .NET Standard, Windows Phone, MONO, Xamarin, Xamarin.iOS, Xamarin.Android
Websitemathparser.org
Repositorygithub.com/mariuszgromada/MathParser.org-mXparser/

mXparser is an open-source mathematical expressions parser/evaluator providing abilities to calculate various expressions at a run time.[1] Expressions definitions are given as plain text, then verified in terms of grammar / syntax, finally calculated. Library source code is maintained separately for Java and C#, providing the same API for Java/JVM, Android, .NET and Mono (Common Language Specification Compliant).

Main features / usage examples

mXparser delivers functionalities such as: basic calculations, implied multiplication, built-in constants and functions, numerical calculus operations, iterated operators, user defined constants, user defined functions, user defined recursion, Unicode mathematical symbols support.

Basic operators

Source:[2]

mXparser supports basic operators, such as: addition '+', subtraction '-', multiplication '*', division '/', factorial '!', power '^', modulo '#'.

Expression e = new Expression("2+3/(4+5)^4");
double v = e.calculate();

Implied multiplication

Source:[2]

Expression e = new Expression("2(3+4)3");
double v = e.calculate();
Expression e = new Expression("2pi(3+4)2sin(3)e");
double v = e.calculate();

Binary relations

Source:[2]

It is possible to combine typical expressions with binary relations (such as: greater than '>', less than '<', equality '=', inequality '<>', greater or equal '>=', lower or equal '<='), as each relation evaluation results in either '1' for true outcome, or '0' for false.

Expression e = new Expression("(2<3)+5");
double v = e.calculate();

Boolean logic

Source:[2]

Boolean logic also operates assuming equivalence of '1 as true' and '0 as false'. Supported Boolean operators include: AND conjunction, OR disjunction, NAND Sheffer stroke, NOR, XOR Exclusive OR, IMP Implication, CIMP Converse implication, NIMP Material nonimplication, CNIMP Converse nonimplication, EQV Logical biconditional, Negation.

Expression e = new Expression("1 --> 0");
double v = e.calculate();

Built-in mathematical functions

Source:[2]

Supported common mathematical functions (unary, binary and variable number of arguments), including: trigonometric functions, inverse trigonometric functions, logarithm functions, exponential function, hyperbolic functions, Inverse hyperbolic functions, Bell numbers, Lucas numbers, Stirling numbers, prime-counting function, exponential integral function, logarithmic integral function, offset logarithmic integral, binomial coefficient and others.

Expression e = new Expression("sin(0)+ln(2)+log(3,9)");
double v = e.calculate();
Expression e = new Expression("min(1,2,3,4)+gcd(1000,100,10)");
double v = e.calculate();
Expression e = new Expression("if(2<1, 3, 4)");
double v = e.calculate();
Expression e = new Expression("iff(2<1, 1; 3<4, 2; 10<2, 3; 5<10, 4)");
double v = e.calculate();

Built-in math constants

Source:[2]

Built-in mathematical constants, with high precision.

Expression e = new Expression("sin(pi)+ln(e)");
double v = e.calculate();

Iterated operators

Source:[2]

Iterated summation and product operators.

Expression e = new Expression("sum(i, 1, 10, ln(i))");
double v = e.calculate();
Expression e = new Expression("prod(i, 1, 10, sin(i))");
double v = e.calculate();

Numerical differentiation and integration

Source:[2]

mXparser delivers implementation of the following calculus operations: differentiation and integration.

Expression e = new Expression("der( sin(x), x )");
double v = e.calculate();
Expression e = new Expression("int( sqrt(1-x^2), x, -1, 1)");
double v = e.calculate();

Prime numbers support

Source:[2]

Expression e = new Expression("ispr(21)");
double v = e.calculate();
Expression e = new Expression("Pi(1000)");
double v = e.calculate();

Unicode mathematical symbols support

Source:[2]

Expression e = new Expression("√2");
double v = e.calculate();
Expression e = new Expression("∜16 + ∛27 + √16");
double v = e.calculate();
Expression e = new Expression("∑(i, 1, 5, i^2)");
double v = e.calculate();

Elements defined by user

Library provides API for creation of user-defined objects, such as: constants, arguments, functions.

User-defined constants

Source:[3]

Constant t = new Constant("t = 2*pi");
Expression e = new Expression("sin(t)", t);
double v = e.calculate();

User-defined arguments

Source:[3]

Argument x = new Argument("x = 5");
Argument y = new Argument("y = 2*x", x);
Expression e = new Expression("sin(x)+y", x, y);
double v = e.calculate();

User-defined functions

Source:[3]

Function f = new Function("f(x, y) = sin(x)+cos(y)");
Expression e = new Expression("f(1,2)", f);
double v = e.calculate();

User-defined variadic functions

Source:[3]

Function f = new Function("f(...) = sum( i, 1, [npar], par(i) )");
Expression e = new Expression("f(1,2,3,4)", f);
double v = e.calculate();

User-defined recursion

Source:[3]

Function fib = new Function("fib(n) = iff( n>1, fib(n-1)+fib(n-2); n=1, 1; n=0, 0 ) )");
Expression e = new Expression("fib(10)", fib);   
double v = e.calculate();

Requirements

Source:[3]

  • Java: JDK 1.5 or higher
  • .NET/Mono: framework 2.0 or higher

Documentation

  • Tutorial[3]
  • Javadoc API specification[4]

mXparser - source code

Source code is maintained and shared on GitHub.[5]

See also

  • List of numerical libraries
  • List of numerical analysis software
  • Mathematical software
  • Exp4j

References

  1. ↑ .org - project page
  2. 1 2 3 4 5 6 7 8 9 10 mXparser - Math Collection
  3. 1 2 3 4 5 6 7 mXparser - Tutorial
  4. ↑ mXparser - API specification
  5. ↑ mXparser - source code on GitHub

External links

  • Official website
  • mXparser on NuGet
  • mXparser on Apache Maven
  • Scalar powered by mXparser
  • ScalarMath.org powered by mXparser
Retrieved from "https://en.wikipedia.org/w/index.php?title=MXparser&oldid=1374753770"
Categories:
  • Free mathematics software
  • Parsing
  • 2010 software
  • Free software programmed in Java
  • Free software programmed in C Sharp
  • Software using the BSD license
  • Free mobile software
  • Software that uses Mono (software)
  • Free and open-source Android software
  • .NET software
  • Computer algebra systems
Hidden categories:
  • Articles with short description
  • Short description is different from Wikidata
  • Official website different in Wikidata and Wikipedia
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.