TO SUPPORT MY WORK, ORDER A COMMERCIAL LICENSE
THANK YOU!
The tutorial consists of more than 200 live examples from 50 sections. Each of the examples can be copied and run on your own environment. In addition, mXparser provides an extensive collection of over 500 built-in math functions, expressions and symbols. Familiarize yourself with the scope and the syntax. Live testing is the best way to learn. Good luck! 🙂
Tutorial Math Collection API spec Download
Below is the code for JAVA, the code for C# is almost identical. To copy the code, double-click inside the frame.
List of available options
// JAVA: import org.mariuszgromada.math.mxparser.*;
// C#: using org.mariuszgromada.math.mxparser;
// ...
// Only built-in elements
List<KeyWord> mXparser.getKeyWords();
List<KeyWord> mXparser.getKeyWords(String query)
// JAVA: import org.mariuszgromada.math.mxparser.*;
// C#: using org.mariuszgromada.math.mxparser;
// ...
// Also with user-defined elements,
// when e is an instance of Expression
List<KeyWord> e.getKeyWords();
List<KeyWord> e.getKeyWords(String query)
For a basic in-line search, simply provide a word (e.g.: "sine"
) in the query
parameter.
Advanced search is also possible, please use one of the tags below when formatting the query
parameter:
"key="
– keyword (e.g.:"key=sin"
)"desc="
– description (e.g.:"desc=trigonometric"
),"syn="
– syntax (e.g.:"syn=sin"
)"type="
– type (e.g.:"type=unit"
)"since="
– since (e.g.:"since=4.1"
)"typeid="
– please refer to parser tokens (e.g.:"typeid=3"
)-
"keyid="
– please refer to parser tokens (e.g.:"keyid=1004"
).
Only one tag can be used per search.
Case 1: Getting list of all keywords
// JAVA: import org.mariuszgromada.math.mxparser.*;
// C#: using org.mariuszgromada.math.mxparser;
// ...
List<KeyWord> helpAsKeywords = mXparser.getKeyWords();
mXparser.consolePrintln("Number of keywords = " + helpAsKeywords.size());
[mXparser-v.5.2.0] Number of keywords = 522
Case 2: Getting list of keywords under advanced search condition
// JAVA: import org.mariuszgromada.math.mxparser.*;
// C#: using org.mariuszgromada.math.mxparser;
// ...
List<KeyWord> helpAsKeywords = mXparser.getKeyWords("type=Bitwise operator");
mXparser.consolePrintln("Number of keywords = " + helpAsKeywords.size());
[mXparser-v.5.2.0] Number of keywords = 6
Case 3: Printing list of keywords
// JAVA: import org.mariuszgromada.math.mxparser.*;
// C#: using org.mariuszgromada.math.mxparser;
// ...
List<KeyWord> helpAsKeywords = mXparser.getKeyWords("type=Bitwise operator");
mXparser.consolePrintln("Number of keywords = " + helpAsKeywords.size());
StringResources stringResources = StringModel.getStringResources();
for (KeyWord kw : helpAsKeywords) {
mXparser.consolePrintln("--------------------");
mXparser.consolePrintln(stringResources.KEYWORD + " = " + kw.wordString);
mXparser.consolePrintln(stringResources.DESCRIPTION + " = " + kw.description);
mXparser.consolePrintln(stringResources.SYNTAX + " = " + kw.syntax);
mXparser.consolePrintln(stringResources.SINCE + " = " + kw.since);
mXparser.consolePrintln(stringResources.TYPE + " = " + Token.getTokenTypeDescription(kw.wordTypeId));
mXparser.consolePrintln("Type id = " + kw.wordTypeId);
mXparser.consolePrintln("id = " + kw.wordId);
}
[mXparser-v.5.2.0] Number of keywords = 6
[mXparser-v.5.2.0] --------------------
[mXparser-v.5.2.0] Keyword = @~
[mXparser-v.5.2.0] Description = Bitwise unary complement - Bitwise operator
[mXparser-v.5.2.0] Syntax = @~a
[mXparser-v.5.2.0] Since = 4.0
[mXparser-v.5.2.0] Type = Bitwise operator
[mXparser-v.5.2.0] Type id = 11
[mXparser-v.5.2.0] id = 1
[mXparser-v.5.2.0] --------------------
[mXparser-v.5.2.0] Keyword = @&
[mXparser-v.5.2.0] Description = Bitwise and AND - Bitwise operator
[mXparser-v.5.2.0] Syntax = a @& b
[mXparser-v.5.2.0] Since = 4.0
[mXparser-v.5.2.0] Type = Bitwise operator
[mXparser-v.5.2.0] Type id = 11
[mXparser-v.5.2.0] id = 2
[mXparser-v.5.2.0] --------------------
[mXparser-v.5.2.0] Keyword = @^
[mXparser-v.5.2.0] Description = Bitwise exclusive or XOR - Bitwise operator
[mXparser-v.5.2.0] Syntax = a @^ b
[mXparser-v.5.2.0] Since = 4.0
[mXparser-v.5.2.0] Type = Bitwise operator
[mXparser-v.5.2.0] Type id = 11
[mXparser-v.5.2.0] id = 3
[mXparser-v.5.2.0] --------------------
[mXparser-v.5.2.0] Keyword = @|
[mXparser-v.5.2.0] Description = Bitwise inclusive or OR - Bitwise operator
[mXparser-v.5.2.0] Syntax = a @| b
[mXparser-v.5.2.0] Since = 4.0
[mXparser-v.5.2.0] Type = Bitwise operator
[mXparser-v.5.2.0] Type id = 11
[mXparser-v.5.2.0] id = 4
[mXparser-v.5.2.0] --------------------
[mXparser-v.5.2.0] Keyword = @<<
[mXparser-v.5.2.0] Description = Signed left shift - Bitwise operator
[mXparser-v.5.2.0] Syntax = a @<< b
[mXparser-v.5.2.0] Since = 4.0
[mXparser-v.5.2.0] Type = Bitwise operator
[mXparser-v.5.2.0] Type id = 11
[mXparser-v.5.2.0] id = 5
[mXparser-v.5.2.0] --------------------
[mXparser-v.5.2.0] Keyword = @>>
[mXparser-v.5.2.0] Description = Signed right shift - Bitwise operator
[mXparser-v.5.2.0] Syntax = a @>> b
[mXparser-v.5.2.0] Since = 4.0
[mXparser-v.5.2.0] Type = Bitwise operator
[mXparser-v.5.2.0] Type id = 11
[mXparser-v.5.2.0] id = 6
Nuget – Package Manager
Install-Package
MathParser.org-mXparser
-Version
6.0.0
dotnet add package
MathParser.org-mXparser
--version
6.0.0
<PackageReference Include=
"MathParser.org-mXparser"
Version=
"6.0.0"
/>
Maven – Dependency
<dependency>
<groupid>org.mariuszgromada.math
</groupid>
<artifactid>MathParser.org-mXparser
</artifactid>
<version>6.0.0
</version>
</dependency>
Maven – Gradle
implementation
'org.mariuszgromada.math:MathParser.org-mXparser:6.0.0'
Maven – Gradle (Kotlin)
implementation(
"org.mariuszgromada.math:MathParser.org-mXparser:6.0.0"
)
GitHub
git clone
https://github.com/mariuszgromada/MathParser.org-mXparser
OTHER DOWNLOAD OPTIONS
Download latest release – v.6.0.0 Picon: .NET bin onlyDownload latest release – v.6.0.0 Picon: JAVA bin onlyDownload latest release – v.6.0.0 Picon: bin + doc
NEWS FROM MATHPARSER.ORG
SOURCE CODE
Source code .zipSource code .tar.gz
View on GitHubMathSpace.pl