### getHelp Output Example Source: https://mathparser.org/mxparser-tutorial/exporting-help-in-the-txt-format Example output from the `getHelp` method when querying for 'type=Bitwise operator', showing keywords, types, syntax, version, and descriptions. ```text [mXparser-v.5.2.0] Help content limited to query: 'type=Bitwise operator' # Keyword Type Syntax Since Description - -------- ---- ------ ----- ----------- 1. @~ @~a 4.0 Bitwise unary complement - Bitwise operator 2. @& a @& b 4.0 Bitwise and AND - Bitwise operator 3. @^ a @^ b 4.0 Bitwise exclusive or XOR - Bitwise operator 4. @| a @| b 4.0 Bitwise inclusive or OR - Bitwise operator 5. @<< a @<< b 4.0 Signed left shift - Bitwise operator 6. @>> a @>> b 4.0 Signed right shift - Bitwise operator ``` -------------------------------- ### C# Hello World Example Source: https://mathparser.org/mxparser-hello-world This C# code snippet demonstrates the 'Hello World' example using mXparser. It converts the string 'Hello' into a decimal number. ```C# using System; using org.mariuszgromada.math.mxparser; public class HelloWorld { public static void Main(string[] args) { // Hello World - Step 1: "Hello" string to decimal number // "Hello" = 72 101 108 108 111 (ASCII codes) // "Hello" = 48656C6C6F (hexadecimal representation) // "Hello" = 310939249775 (decimal number) // Expression for "Hello" string Expression eHello = new Expression("Hello", mXparser.get()); // Print decimal representation of "Hello" string Console.WriteLine("Hello = " + eHello.calculate()); // Expression for "World!" string Expression eWorld = new Expression("World!", mXparser.get()); // Print decimal representation of "World!" string Console.WriteLine("World! = " + eWorld.calculate()); } } ``` -------------------------------- ### C++/CLI Hello World Example Source: https://mathparser.org/mxparser-hello-world This C++/CLI code snippet demonstrates the 'Hello World' example using mXparser. It converts the string 'Hello' into a decimal number. ```C++/CLI #using using namespace System; using namespace org::mariuszgromada::math::mxparser; int main(array ^args) { // Hello World - Step 1: "Hello" string to decimal number // "Hello" = 72 101 108 108 111 (ASCII codes) // "Hello" = 48656C6C6F (hexadecimal representation) // "Hello" = 310939249775 (decimal number) // Expression for "Hello" string Expression ^eHello = gcnew Expression("Hello", mXparser::get()); // Print decimal representation of "Hello" string Console::WriteLine("Hello = " + eHello->calculate()); // Expression for "World!" string Expression ^eWorld = gcnew Expression("World!", mXparser::get()); // Print decimal representation of "World!" string Console::WriteLine("World! = " + eWorld->calculate()); return 0; } ``` -------------------------------- ### Get Help as Markdown Table (C++) Source: https://mathparser.org/mxparser-tutorial/exporting-help-in-the-markdown-table-format This C++ example demonstrates retrieving help content in Markdown table format using mXparser. It filters the help for 'type=Bitwise operator' and includes header and caption. ```cpp #include "org/mariuszgromada/math/mxparser.hpp" // ... StringPtr helpMarkdown = mXparser::getHelpAsMarkdownTable( "type=Bitwise operator" ,true ,true ,""); mXparser::consolePrint("\n"); mXparser::consolePrintln(helpMarkdown); ``` -------------------------------- ### F# Hello World Example Source: https://mathparser.org/mxparser-hello-world This F# code snippet demonstrates the 'Hello World' example using mXparser. It converts the string 'Hello' into a decimal number. ```F# open System open org.mariuszgromada.math.mxparser [] let main argv = // Hello World - Step 1: "Hello" string to decimal number // "Hello" = 72 101 108 108 111 (ASCII codes) // "Hello" = 48656C6C6F (hexadecimal representation) // "Hello" = 310939249775 (decimal number) // Expression for "Hello" string let eHello = new Expression("Hello", mXparser.get()) // Print decimal representation of "Hello" string printfn "Hello = %f" eHello.calculate() // Expression for "World!" string let eWorld = new Expression("World!", mXparser.get()) // Print decimal representation of "World!" string printfn "World! = %f" eWorld.calculate() 0 // return an integer exit code ``` -------------------------------- ### Unicode Math Keyword Example Output Source: https://mathparser.org/mxparser-tutorial/unicode-math This is an example output showing the help content for the 'unicode' query, listing various Unicode math operators and their descriptions. ```text [mXparser-v.5.2.1] Help content limited to query: 'unicode' # Keyword Type Syntax Since Description - -------- ---- ------ ----- ----------- 1. × a × b 5.0 Multiplication - Operator - Unicode math symbol 2. ⨉ a ⨉ b 5.0 Multiplication - Operator - Unicode math symbol 3. ∙ a ∙ b 5.0 Multiplication - Operator - Unicode math symbol 4. ÷ a ÷ b 5.0 Division - Operator - Unicode math symbol 5. √ √x 5.0 Square root - Operator - Unicode math symbol 6. ∛ ∛x 5.0 Cube root - Operator - Unicode math symbol 7. ∜ ∜x 5.0 Fourth root - Operator - Unicode math symbol 8. ∧ p ∧ q 5.0 Logical conjunction AND - Boolean operator - Unicode math symbol 9. ⊼ p ⊼ q 5.0 Sheffer stroke NAND - Boolean operator - Unicode math symbol 10. ~∧ p ~∧ q 5.0 Sheffer stroke NAND - Boolean operator - Unicode math symbol 11. ¬& p ¬& q 5.0 Sheffer stroke NAND - Boolean operator - Unicode math symbol 12. ¬∧ p ¬∧ q 5.0 Sheffer stroke NAND - Boolean operator - Unicode math symbol 13. ¬&& p ¬&& q 5.0 Sheffer stroke NAND - Boolean operator - Unicode math symbol 14. ¬/ p ¬/ q 5.0 Sheffer stroke NAND - Boolean operator - Unicode math symbol 15. ∨ p ∨ q 5.0 Logical disjunction OR - Boolean operator - Unicode math symbol 16. ⊽ p ⊽ q 5.0 Logical not or (joint denial) NOR - Boolean operator - Unicode math symbol 17. ~∨ p ~∨ q 5.0 Logical not or (joint denial) NOR - Boolean operator - Unicode math symbol 18. ¬| p ¬| q 5.0 Logical not or (joint denial) NOR - Boolean operator - Unicode math symbol 19. ¬∨ p ¬∨ q 5.0 Logical not or (joint denial) NOR - Boolean operator - Unicode math symbol 20. ``` -------------------------------- ### Java Hello World Example Source: https://mathparser.org/mxparser-hello-world This Java code snippet demonstrates the 'Hello World' example using mXparser. It converts the string 'Hello' into a decimal number. ```Java import org.mariuszgromada.math.mxparser.*; public class HelloWorld { public static void main(String[] args) { // Hello World - Step 1: "Hello" string to decimal number // "Hello" = 72 101 108 108 111 (ASCII codes) // "Hello" = 48656C6C6F (hexadecimal representation) // "Hello" = 310939249775 (decimal number) // Expression for "Hello" string Expression eHello = new Expression("Hello", mXparser.get()); // Print decimal representation of "Hello" string System.out.println("Hello = " + eHello.calculate()); // Expression for "World!" string Expression eWorld = new Expression("World!", mXparser.get()); // Print decimal representation of "World!" string System.out.println("World! = " + eWorld.calculate()); } } ``` -------------------------------- ### Visual Basic Hello World Example Source: https://mathparser.org/mxparser-hello-world This Visual Basic code snippet demonstrates the 'Hello World' example using mXparser. It converts the string 'Hello' into a decimal number. ```Visual Basic Imports System Imports org.mariuszgromada.math.mxparser Public Module HelloWorld Public Sub Main() ' Hello World - Step 1: "Hello" string to decimal number ' "Hello" = 72 101 108 108 111 (ASCII codes) ' "Hello" = 48656C6C6F (hexadecimal representation) ' "Hello" = 310939249775 (decimal number) ' Expression for "Hello" string Dim eHello As New Expression("Hello", mXparser.get()) ' Print decimal representation of "Hello" string Console.WriteLine("Hello = " & eHello.calculate()) ' Expression for "World!" string Dim eWorld As New Expression("World!", mXparser.get()) ' Print decimal representation of "World!" string Console.WriteLine("World! = " & eWorld.calculate()) End Sub End Module ``` -------------------------------- ### Install mXparser via Nuget (C#) Source: https://mathparser.org/mxparser-math-collection/variadic-functions Install the mXparser library for C# and other .NET languages using the Nuget Package Manager. ```csharp Install-Package MathParser.org-mXparser-Version 6.1.1 ``` ```csharp dotnet add package MathParser.org-mXparser --version 6.1.1 ``` ```xml ``` -------------------------------- ### mXparser Package Manager Installation (Nuget) Source: https://mathparser.org/mxparser-tutorial/derivatives-integrals Instructions for installing the MathParser.org-mXparser package using Nuget Package Manager, .NET CLI, or Package Reference. ```Package Manager Console Install-Package **MathParser.org-mXparser**-Version **6.1.1** ``` ```.NET CLI dotnet add package **MathParser.org-mXparser**--version **6.1.1** ``` ```Package Reference ``` -------------------------------- ### Install mXparser Package Source: https://mathparser.org/release-notes/mxparser-on-nuget-org Use this command in the Package Manager Console to install the MathParser.org-mXparser package. ```powershell PM> Install-Package MathParser.org-mXparser ``` -------------------------------- ### Get Help as Markdown Table (Java/C#) Source: https://mathparser.org/mxparser-tutorial/exporting-help-in-the-markdown-table-format Use the getHelpAsMarkdownTable method to retrieve help content formatted as a Markdown table. This example shows how to filter by 'type=Bitwise operator' and includes header and caption. ```java // JAVA: import org.mariuszgromada.math.mxparser.* // C#: using org.mariuszgromada.math.mxparser; // ... String helpMarkdown = mXparser.getHelpAsMarkdownTable( "type=Bitwise operator" ,true ,true ,""); mXparser.consolePrint("\n"); mXparser.consolePrintln(helpMarkdown); ``` ```csharp // JAVA: import org.mariuszgromada.math.mxparser.* // C#: using org.mariuszgromada.math.mxparser; // ... String helpMarkdown = mXparser.getHelpAsMarkdownTable( "type=Bitwise operator" ,true ,true ,""); mXparser.consolePrint("\n"); mXparser.consolePrintln(helpMarkdown); ``` -------------------------------- ### JavaDoc Search Examples Source: https://mathparser.org/api/help-doc.html Examples demonstrating how to use the JavaDoc search feature with various query types, including full names, camelCase abbreviations, and partial matches. ```text j.l.obj ``` ```text InpStr ``` ```text HM.cK ``` -------------------------------- ### Install mXparser via Nuget (Package Manager) Source: https://mathparser.org/2017/12 Use this command to install the mXparser library in C#, F#, or Visual Basic projects using the Nuget Package Manager. ```powershell Install-Package MathParser.org-mXparser-Version 6.1.1 ``` -------------------------------- ### Install mXparser via Nuget (Package Manager) Source: https://mathparser.org/2017/03 Use this command to install the mXparser package using the Nuget Package Manager for C#, F#, and Visual Basic projects. ```powershell Install-Package **MathParser.org-mXparser**-Version **6.1.1** ``` -------------------------------- ### Java/C# - Get Help as JSON with Advanced Search Source: https://mathparser.org/mxparser-tutorial/exporting-help-in-the-json-format Use the getHelpAsJson function to retrieve help content in JSON format. This example demonstrates searching for 'Bitwise operator' with a standard caption. ```java // JAVA: import org.mariuszgromada.math.mxparser.* // C#: using org.mariuszgromada.math.mxparser; // ... String helpJson = mXparser.getHelpAsJson( "type=Bitwise operator", true, ""); mXparser.consolePrint("\n"); mXparser.consolePrintln(helpJson); ``` -------------------------------- ### Java Hello World with mXparser Source: https://mathparser.org/mxparser-hello-world/mxparser-hello-world-java This is the main 'Hello World!' example for Java. It demonstrates how to create an Expression object, calculate its value, convert the number to an ASCII string, and print it to the console using mXparser's utility methods. ```Java package mxparser.helloworld; import org.mariuszgromada.math.mxparser.*; public class HelloWorld { public static void main(String[] args) { Expression eh = new Expression("5^2 * 7^3 * 11^1 * 67^1 * 49201^1"); Expression ew = new Expression("71^1 * 218549^1 * 6195547^1"); String h = mXparser.numberToAsciiString( eh.calculate() ); String w = mXparser.numberToAsciiString( ew.calculate() ); mXparser.consolePrintln(h + " " + w); } } ``` -------------------------------- ### Get Parameter Name Source: https://mathparser.org/api/org/mariuszgromada/math/mxparser/Function.html Gets the name of a user-defined function parameter by its index. ```APIDOC ## getParameterName ### Description Gets user defined function parameter name. ### Method public String getParameterName(int parameterIndex) ### Parameters * `parameterIndex` - the parameter index ``` -------------------------------- ### Get Parameters Number Source: https://mathparser.org/api/org/mariuszgromada/math/mxparser/Function.html Gets the number of parameters associated with the function expression. ```APIDOC ## getParametersNumber ### Description Gets number of parameters associated with the function expression. ### Method public int getParametersNumber() ### Returns The number of function parameters (int >= 0) ### See Also * `Argument` * `RecursiveArgument` ``` -------------------------------- ### Get Argument by Index Source: https://mathparser.org/api/org/mariuszgromada/math/mxparser/Function.html Gets an Argument object from the function expression using its index. ```APIDOC ## getArgument ### Description Gets argument from the function expression. ### Method public Argument getArgument(int argumentIndex) ### Parameters * `argumentIndex` - the argument index ### Returns Argument if the argument index is between 0 and the last available argument index (getArgumentsNumber()-1), otherwise returns null. ### See Also * `Argument` * `RecursiveArgument` ``` -------------------------------- ### Print StringModel Descriptions (C++) Source: https://mathparser.org/mxparser-tutorial/validating-string-model This C++ example shows how to print all descriptions generated by the StringModel. Include the necessary mXparser header file. ```cpp #include "org/mariuszgromada/math/mxparser.hpp" // ... // Prints all the descriptions // generated based on the string resources StringModel::printDescriptions(); ``` -------------------------------- ### Get Argument by Name Source: https://mathparser.org/api/org/mariuszgromada/math/mxparser/Function.html Gets an Argument object from the function expression using its name. ```APIDOC ## getArgument ### Description Gets argument from the function expression. ### Method public Argument getArgument(String argumentName) ### Parameters * `argumentName` - the argument name ### Returns The argument if the argument name was found, otherwise returns null. ### See Also * `Argument` * `RecursiveArgument` ``` -------------------------------- ### Get Argument Index by Name Source: https://mathparser.org/api/org/mariuszgromada/math/mxparser/Function.html Gets the index of an argument from the function expression using its name. ```APIDOC ## getArgumentIndex ### Description Gets argument index from the function expression. ### Method public int getArgumentIndex(String argumentName) ### Parameters * `argumentName` - the argument name ### Returns The argument index if the argument name was found, otherwise returns Argument.NOT_FOUND ### See Also * `Argument` * `RecursiveArgument` ``` -------------------------------- ### Export Help as CSV (C++) Source: https://mathparser.org/mxparser-tutorial/exporting-help-in-the-csv-format This C++ snippet demonstrates how to obtain help information in CSV format, similar to the Java/C# example. It supports custom quotation and delimiter settings, and omits the header. ```C++ #include "org/mariuszgromada/math/mxparser.hpp" // ... StringPtr helpCsv = mXparser::getHelpAsCsv("type=Bitwise operator", "\"", ";", false); mXparser::consolePrint("\n"); mXparser::consolePrintln(helpCsv); ``` -------------------------------- ### C++ getHelp Method Example Source: https://mathparser.org/mxparser-tutorial/exporting-help-in-the-txt-format Shows how to use the `getHelp` method in C++ to retrieve help content for a specific type, with header and standard caption enabled. ```cpp #include "org/mariuszgromada/math/mxparser.hpp" // ... mXparser::consolePrint("\n"); StringPtr helpTxt = mXparser::getHelp("type=Bitwise operator", true, true, ""); mXparser::consolePrintln(helpTxt); ``` -------------------------------- ### C++ IF Function Example Source: https://mathparser.org/mxparser-tutorial/if-and-iff-functions Illustrates the IF function in C++ using mXparser. This example shows how to create and calculate expressions with the IF function in a C++ environment. ```C++ #include "org/mariuszgromada/math/mxparser.hpp" // ... ExpressionPtr e1 = new_Expression("if(2<3, 1, 2)"); ExpressionPtr e2 = new_Expression("if(4<3, 1, 2)"); mXparser::consolePrintln("Res 1: " + e1->getExpressionString() + " = " + e1->calculate()); mXparser::consolePrintln("Res 2: " + e2->getExpressionString() + " = " + e2->calculate()); ``` -------------------------------- ### Display Full Help (Java/C#) Source: https://mathparser.org/mxparser-tutorial/using-internal-help Use this snippet to print the complete internal help documentation to the console. Ensure the mXparser library is imported. ```Java // JAVA: import org.mariuszgromada.math.mxparser.* // ... mXparser.consolePrintHelp(); ``` ```C# // C#: using org.mariuszgromada.math.mxparser; // ... mXparser.consolePrintHelp(); ``` -------------------------------- ### mXparser Help JSON Output Example Source: https://mathparser.org/mxparser-tutorial/exporting-help-in-the-json-format This is an example of the JSON output returned by the getHelpAsJson function, detailing bitwise operators available in mXparser. ```json [mXparser-v.5.2.0] [ { "Caption": "Help content limited to query: 'type=Bitwise operator'" }, { "Keyword": "@~", "Type": "Bitwise operator", "Syntax": "@~a", "Since": "4.0", "Description": "Bitwise unary complement - Bitwise operator" }, { "Keyword": "@&", "Type": "Bitwise operator", "Syntax": "a @& b", "Since": "4.0", "Description": "Bitwise and AND - Bitwise operator" }, { "Keyword": "@^", "Type": "Bitwise operator", "Syntax": "a @^ b", "Since": "4.0", "Description": "Bitwise exclusive or XOR - Bitwise operator" }, { "Keyword": "@|", "Type": "Bitwise operator", "Syntax": "a @| b", "Since": "4.0", "Description": "Bitwise inclusive or OR - Bitwise operator" }, { "Keyword": "@<<", "Type": "Bitwise operator", "Syntax": "a @<< b", "Since": "4.0", "Description": "Signed left shift - Bitwise operator" }, { "Keyword": "@>>", "Type": "Bitwise operator", "Syntax": "a @>> b", "Since": "4.0", "Description": "Signed right shift - Bitwise operator" }] ``` -------------------------------- ### Java Demo: Define and Use User Function Source: https://mathparser.org/2017/11 Example demonstrating how to define a user-defined function and use it within an expression in Java. ```java // JAVA Demo – showing how easy it is to define a user function along with its use in an expression ``` -------------------------------- ### F# mXparser Hello World Example Source: https://mathparser.org/mxparser-hello-world/mxparser-hello-world-f-sharp This F# code snippet demonstrates how to initialize mXparser, define two expressions, calculate their values, convert the results to strings, and print them to the console. ```fsharp 12345678910| open org.mariuszgromada.math.mxparser [] let main argv = let eh = Expression("5^2 * 7^3 * 11^1 * 67^1 * 49201^1") let ew = Expression("71^1 * 218549^1 * 6195547^1") let h = mXparser.numberToAsciiString( eh.calculate() ) let w = mXparser.numberToAsciiString( ew.calculate() ) mXparser.consolePrintln(h + " " + w); 0 // return an integer exit code ---|--- ``` -------------------------------- ### Code Result Example Source: https://mathparser.org/mxparser-tutorial/built-in-random-variables Shows sample output from the random natural number generation examples, demonstrating the results of [nat1] and [Nat3] calculations. ```text [mXparser-v.5.2.1] Res. 1: [nat1] = 10 [mXparser-v.5.2.1] Res. 2: [nat1] = 0 [mXparser-v.5.2.1] Res. 3: [Nat3] = 90 [mXparser-v.5.2.1] Res. 4: [Nat3] = 51 ``` -------------------------------- ### Java/C# getHelp Method Example Source: https://mathparser.org/mxparser-tutorial/exporting-help-in-the-txt-format Demonstrates how to use the `getHelp` method in Java and C# to retrieve help content for a specific type, with header and standard caption enabled. ```java // JAVA: import org.mariuszgromada.math.mxparser.* // C#: using org.mariuszgromada.math.mxparser; // ... mXparser.consolePrint("\n"); String helpTxt = mXparser.getHelp("type=Bitwise operator", true, true, ""); mXparser.consolePrintln(helpTxt); ``` -------------------------------- ### getHelp (general) Source: https://mathparser.org/api/org/mariuszgromada/math/mxparser/Expression.html Returns comprehensive user help documentation regarding the syntax of mathematical expressions supported by the parser. ```APIDOC ## getHelp ### Description Returns detailed user help on the syntax of mathematical expressions. ### Method public String getHelp() ### Returns One string value containing all the help. ``` -------------------------------- ### ALL_HELP_CONTENT Source: https://mathparser.org/api/index-all.html Default String = "All help content." ```APIDOC ## ALL_HELP_CONTENT ### Description Default String = "All help content." ### Method Variable ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Code Result of IFF Function Examples Source: https://mathparser.org/mxparser-tutorial/if-and-iff-functions Displays the output generated from the Java/C# and C++ code examples when evaluating the IFF function with different values of x. ```text [mXparser-v.5.2.1] Res 1: x = 0.5, iff(x<1, 1; x<2, 2; x<3, 3) = 1.0 [mXparser-v.5.2.1] Res 2: x = 1.5, iff(x<1, 1; x<2, 2; x<3, 3) = 2.0 [mXparser-v.5.2.1] Res 3: x = 2.5, iff(x<1, 1; x<2, 2; x<3, 3) = 3.0 [mXparser-v.5.2.1] Res 4: x = 3.5, iff(x<1, 1; x<2, 2; x<3, 3) = NaN ``` -------------------------------- ### Display Full Help (C++) Source: https://mathparser.org/mxparser-tutorial/using-internal-help This C++ snippet prints the complete internal help documentation to the console. Include the mXparser header file. ```C++ #include "org/mariuszgromada/math/mxparser.hpp" // ... mXparser::consolePrintHelp(); ``` -------------------------------- ### Utility Methods Source: https://mathparser.org/api/org/mariuszgromada/math/mxparser/mXparser.html Methods for fraction conversion, retrieving token details, and getting console output. ```APIDOC ## fractionToString(double[] fraction) ### Description Converts an array representing a fraction to its string representation. ### Method `static String` ### Endpoint N/A (static method) ## getBuiltinTokensToModify() ### Description Returns details on tokens that are marked to be modified. ### Method `static String[][]` ### Endpoint N/A (static method) ## getBuiltinTokensToRemove() ### Description Returns the current list of tokens that are marked to be removed. ### Method `static String[]` ### Endpoint N/A (static method) ## getConsoleOutput() ### Description Returns the console output string, which is built by `consolePrintln()` and `consolePrint()` methods. ### Method `static String` ### Endpoint N/A (static method) ## getEpsilon() ### Description Returns the current epsilon value. ### Method `static double` ### Endpoint N/A (static method) ``` -------------------------------- ### Generate HTML Help Table (C++) Source: https://mathparser.org/mxparser-tutorial/exporting-help-in-the-html-table-format Utilize the mXparser::getHelpAsHtmlTable function in C++ to create an HTML table for help documentation. This example includes the necessary header file and demonstrates the usage of query parameters and formatting flags. ```C++ #include "org/mariuszgromada/math/mxparser.hpp" // ... StringPtr helpHtml = mXparser::getHelpAsHtmlTable( "type=Bitwise operator", true, true, true, "", "wp-block-table" ); mXparser::consolePrint("\n"); mXparser::consolePrintln(helpHtml); ``` -------------------------------- ### Code Result: Bitwise Operator Help Output Source: https://mathparser.org/mxparser-tutorial/exporting-help-in-the-txt-format Example output when requesting help for bitwise operators with a user-defined caption. Displays keywords, types, syntax, and descriptions. ```text [mXparser-v.5.2.0] This is a caption # Keyword Type Syntax Since Description - -------- ---- ------ ----- ----------- 1. @~ @~a 4.0 Bitwise unary complement - Bitwise operator 2. @& a @& b 4.0 Bitwise and AND - Bitwise operator 3. @^ a @^ b 4.0 Bitwise exclusive or XOR - Bitwise operator 4. @| a @| b 4.0 Bitwise inclusive or OR - Bitwise operator 5. @<< a @<< b 4.0 Signed left shift - Bitwise operator 6. @>> a @>> b 4.0 Signed right shift - Bitwise operator ``` -------------------------------- ### getHelp() Source: https://mathparser.org/api/index-all.html Provides detailed user help on the syntax of mathematical expressions. ```APIDOC ## getHelp() ### Description Returns detailed user help on the syntax of mathematical expressions. This method is available for `Expression` and `mXparser` classes, with variations accepting different parameters for more specific help content. ### Method - `Expression.getHelp()` - `Expression.getHelp(boolean, boolean, String)` - `Expression.getHelp(String)` - `Expression.getHelp(String, boolean, boolean, String)` - `mXparser.getHelp()` (static) - `mXparser.getHelp(boolean, boolean, String)` (static) - `mXparser.getHelp(String)` (static) ``` -------------------------------- ### C++ Summation Operator Examples Source: https://mathparser.org/mxparser-tutorial/summation-product-iterated-operators Demonstrates the use of the SIGMA summation operator in C++. Includes examples with integer and non-integer increments. Ensure the mXparser header is included. ```C++ #include "org/mariuszgromada/math/mxparser.hpp" // ... ExpressionPtr e1 = new_Expression("sum(i, 1, 10, 2*i)"); mXparser::consolePrintln("Res 1: " + e1->getExpressionString() + " = " + e1->calculate()); /* Iteration can be done by not necessarily whole increment */ ExpressionPtr e2 = new_Expression("sum(i, 1, 10, i, 0.5)"); mXparser::consolePrintln("Res 2: " + e2->getExpressionString() + " = " + e2->calculate()); ``` -------------------------------- ### Java/C# Summation Operator Examples Source: https://mathparser.org/mxparser-tutorial/summation-product-iterated-operators Demonstrates the use of the SIGMA summation operator in Java and C#. Includes examples with integer and non-integer increments. Ensure the mXparser library is imported. ```Java // JAVA: import org.mariuszgromada.math.mxparser.*; // C#: using org.mariuszgromada.math.mxparser; // ... Expression e1 = new Expression("sum(i, 1, 10, 2*i)"); mXparser.consolePrintln("Res 1: " + e1.getExpressionString() + " = " + e1.calculate()); /* Iteration can be done by not necessarily whole increment */ Expression e2 = new Expression("sum(i, 1, 10, i, 0.5)"); mXparser.consolePrintln("Res 2: " + e2.getExpressionString() + " = " + e2.calculate()); ``` -------------------------------- ### Get Help as JSON (Java/C#) Source: https://mathparser.org/mxparser-tutorial/exporting-help-in-the-json-format Use this snippet to retrieve help information for a specific type of element (e.g., 'Bitwise operator') in JSON format, with an option to include a user-defined caption. This is useful for dynamically displaying documentation within your application. ```Java // JAVA: import org.mariuszgromada.math.mxparser.* // C#: using org.mariuszgromada.math.mxparser; // ... String helpJson = mXparser.getHelpAsJson( "type=Bitwise operator", true, "This is a caption"); mXparser.consolePrint("\n"); mXparser.consolePrintln(helpJson); ``` -------------------------------- ### Java/C# Get Help as HTML Table (With User-Defined Elements) Source: https://mathparser.org/mxparser-tutorial/exporting-help-in-the-html-table-format Retrieve documentation for user-defined elements (expressions) as an HTML table. This method allows for query-based filtering and customization of the table's header, caption, and CSS class. ```Java // JAVA: import org.mariuszgromada.math.mxparser.* // C#: using org.mariuszgromada.math.mxparser; // ... // Also with user-defined elements, when e is an instance of Expression String e.getHelpAsHtmlTable(); String e.getHelpAsHtmlTable(String query); String e.getHelpAsHtmlTable( boolean addHeader ,boolean addCaption ,boolean addFigure ,String caption ,String cssClass ); String e.getHelpAsHtmlTable( String query ,boolean addHeader ,boolean addCaption ,boolean addFigure ,String caption ,String cssClass ); ``` ```C# // JAVA: import org.mariuszgromada.math.mxparser.* // C#: using org.mariuszgromada.math.mxparser; // ... // Also with user-defined elements, when e is an instance of Expression String e.getHelpAsHtmlTable(); String e.getHelpAsHtmlTable(String query); String e.getHelpAsHtmlTable( boolean addHeader ,boolean addCaption ,boolean addFigure ,String caption ,String cssClass ); String e.getHelpAsHtmlTable( String query ,boolean addHeader ,boolean addCaption ,boolean addFigure ,String caption ,String cssClass ); ``` -------------------------------- ### Get and Set Threads Number (Java/C#) Source: https://mathparser.org/mxparser-tutorial/extensive-list-of-settings Configure the number of threads mXparser uses for calculations. Includes methods to get the current number, set a specific number, and reset to the default. ```java int mXparser.getThreadsNumber(); void mXparser.setThreadsNumber(int threadsNumber); void mXparser.setDefaultThreadsNumber(); ``` -------------------------------- ### CSV Output Example for Bitwise Operators Source: https://mathparser.org/mxparser-tutorial/exporting-help-in-the-csv-format This is an example of the CSV output generated by mXparser when requesting help for bitwise operators without a header and using specific quotation and delimiter settings. ```text [mXparser-v.5.2.0] "@~";"Bitwise operator";"@~a";"4.0";"Bitwise unary complement - Bitwise operator"@&";"Bitwise operator";"a @& b";"4.0";"Bitwise and AND - Bitwise operator"@^";"Bitwise operator";"a @^ b";"4.0";"Bitwise exclusive or XOR - Bitwise operator"@|";"Bitwise operator";"a @| b";"4.0";"Bitwise inclusive or OR - Bitwise operator"@<<";"Bitwise operator";"a @<< b";"4.0";"Signed left shift - Bitwise operator"@>>";"Bitwise operator";"a @>> b";"4.0";"Signed right shift - Bitwise operator" ``` -------------------------------- ### getHelp (query) Source: https://mathparser.org/api/org/mariuszgromada/math/mxparser/Expression.html Returns detailed user help on the syntax of mathematical expressions, allowing for specific searches using a query string. ```APIDOC ## getHelp ### Description Returns detailed user help on the syntax of mathematical expressions. Allows simple and advanced searches. ### Method public String getHelp(String query) ### Parameters * `query` (String) - The search query for help documentation. ``` -------------------------------- ### Get and Set Threads Number (C++) Source: https://mathparser.org/mxparser-tutorial/extensive-list-of-settings Configure the number of threads mXparser uses for calculations in C++. Includes methods to get the current number, set a specific number, and reset to the default. ```cpp int mXparser::getThreadsNumber(); void mXparser::setThreadsNumber(int threadsNumber); void mXparser::setDefaultThreadsNumber(); ``` -------------------------------- ### Install mXparser via Nuget (.NET CLI) Source: https://mathparser.org/2017/12 Add the mXparser library to your .NET project using the .NET CLI. ```bash dotnet add package MathParser.org-mXparser--version 6.1.1 ``` -------------------------------- ### getLicense() Source: https://mathparser.org/api/org/mariuszgromada/math/mxparser/mXparser.html Gets the license information for mXparser. ```APIDOC ## getLicense() ### Description Gets the license information for mXparser. ### Method `static String` ### Signature `getLicense()` ``` -------------------------------- ### Java/C# String Resources Configuration Source: https://mathparser.org/mxparser-tutorial/configuration-of-your-own-translation Demonstrates how to set custom or default string resources, retrieve current resources, and print model/resource information in Java and C#. ```java // JAVA: import org.mariuszgromada.math.mxparser.* // C#: using org.mariuszgromada.math.mxparser; // ... // To set your own string resources StringModel.setStringResources(stringResources); // To set default string resources StringModel.setDefaultStringResources(); // To get currently used string resources StringResources StringModel.getStringResources(); // To print current model StringModel.print(); // To print elements description StringModel.printDescriptions(); // To print text resources StringResources.print(); // To print initial source code // to define text resources StringResources.printInitSrc(); ``` -------------------------------- ### getConstantName Source: https://mathparser.org/api/index-all.html Method to get the name of a Constant object. ```APIDOC ## getConstantName() ### Description Gets the constant name. ### Method Instance ### Endpoint N/A (Instance method) ### Parameters None ### Response The name of the constant. ``` -------------------------------- ### mXparser Hello World C++/CLI Example Source: https://mathparser.org/mxparser-hello-world/mxparser-hello-world-cpp-cli This C++/CLI code snippet demonstrates basic usage of mXparser to calculate and print the results of two mathematical expressions. ```cpp #include "stdafx.h" using namespace System; using namespace org::mariuszgromada::math::mxparser; int main(array ^args) { Expression ^eh = gcnew Expression("5^2 * 7^3 * 11^1 * 67^1 * 49201^1"); Expression ^ew = gcnew Expression("71^1 * 218549^1 * 6195547^1"); String ^h = mXparser::numberToAsciiString(eh->calculate()); String ^w = mXparser::numberToAsciiString(ew->calculate()); mXparser::consolePrintln(h + " " + w); return 0; } ``` -------------------------------- ### getConstant Source: https://mathparser.org/api/org/mariuszgromada/math/mxparser/Function.html Gets a constant associated with the function expression. ```APIDOC ## getConstant (String) ### Description Gets constant associated with the function expression. ### Method public Constant getConstant(String constantName) ### Parameters * `constantName` - the constant name ### Returns Constant if constant name was found, otherwise return null. ### See Also * `Constant` ``` ```APIDOC ## getConstant (int) ### Description Gets constant associated with the function expression. ### Method public Constant getConstant(int constantIndex) ### Parameters * `constantIndex` - the constant index ### Returns Constant if the constantIndex is between 0 and the last available constant index (getConstantsNumber() - 1), otherwise it returns null. ### See Also * `Constant` ``` -------------------------------- ### getHelp() Source: https://mathparser.org/api/org/mariuszgromada/math/mxparser/mXparser.html Retrieves detailed user help on the syntax of mathematical expressions in a Markdown table format. Supports simple and advanced searches. ```APIDOC ## getHelp() ### Description Retrieves detailed user help on the syntax of mathematical expressions in a Markdown table format. Supports simple and advanced searches. ### Method public static String getHelp(String query, boolean addHeader, boolean addCaption, String caption) ### Parameters #### Query Parameters - **query** (String) - For a simple search, simply enter a word (e.g.: "sine"). Advanced search is also possible, please use one of the tags below: "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. - **addHeader** (boolean) - Indicator whether to add a header. - **addCaption** (boolean) - Indicator whether to add caption. - **caption** (String) - If a non-standard caption is to be added, use any string other than "". ### Returns One string value containing all the help. String in Markdown table format. ``` -------------------------------- ### mXparser.getThreadsNumber Source: https://mathparser.org/api/index-all.html Gets the maximum number of threads that can be used by the mXparser. ```APIDOC ## getThreadsNumber() ### Description Gets maximum threads number. ### Method Static method ### Response * **int** - The maximum number of threads. ``` -------------------------------- ### Constant.getSyntaxStatus Source: https://mathparser.org/api/index-all.html Gets the syntax status of the expression associated with the constant. ```APIDOC ## getSyntaxStatus() ### Description Gets syntax status of the expression. ### Method Method ### Response * **int** - The syntax status code. ``` -------------------------------- ### Help Methods Source: https://mathparser.org/api/org/mariuszgromada/math/mxparser/mXparser.html Methods for retrieving user help documentation on mathematical expression syntax. ```APIDOC ## getHelp (void) ### Description Returns detailed user help on the syntax of mathematical expressions. ### Method `public static String getHelp()` ### Returns A string containing all the help information. ## getHelp (String) ### Description Returns detailed user help on the syntax of mathematical expressions, allowing for simple and advanced searches. ### Method `public static String getHelp(String query)` ### Parameters * `query` (String) - The search query for help documentation. ``` -------------------------------- ### getCanonicalExpressionString Source: https://mathparser.org/api/index-all.html Method to get the canonical string representation of an expression. ```APIDOC ## getCanonicalExpressionString() ### Description Returns the canonical expression string. ### Method Instance ### Endpoint N/A (Instance method) ### Parameters None ### Response Canonical expression string. ``` -------------------------------- ### getThreadsNumber() Source: https://mathparser.org/api/org/mariuszgromada/math/mxparser/mXparser.html Gets the maximum number of threads that can be used by the parser. ```APIDOC ## getThreadsNumber() ### Description Gets the maximum number of threads that can be used by the parser. ### Method `static int` ### Signature `getThreadsNumber()` ``` -------------------------------- ### getHelp(boolean, boolean, String) Source: https://mathparser.org/api/org/mariuszgromada/math/mxparser/mXparser.html Returns detailed user help on the syntax of mathematical expressions. Allows simple and advanced searches with customizable headers and captions. ```APIDOC ## getHelp(boolean addHeader, boolean addCaption, String caption) ### Description Returns detailed user help on the syntax of mathematical expressions. Allows simple and advanced searches with customizable headers and captions. ### Method Signature public static String getHelp(boolean addHeader, boolean addCaption, String caption) ### Parameters * `addHeader` (boolean) - Indicator whether to add a header. * `addCaption` (boolean) - Indicator whether to add caption. * `caption` (String) - If a non-standard caption is to be added, any string other than "" will replace the standard caption with the one specified by the user. ### Returns One string value containing all the help. ``` -------------------------------- ### Java/C# Example with IFF Function Source: https://mathparser.org/mxparser-tutorial/if-and-iff-functions Demonstrates the 'iff' function in Java and C# with multiple conditions. Ensure the mXparser library is imported. ```Java/C# // JAVA: import org.mariuszgromada.math.mxparser.*; // C#: using org.mariuszgromada.math.mxparser; // ... Argument x = new Argument("x = 0.5"); Expression e = new Expression("iff(x<1, 1; x<2, 2; x<3, 3; x<4, 4; x<5, 5)", x); mXparser.consolePrintln("Res 1: " + " x = " + x.getArgumentValue() + ", " + e.getExpressionString() + " = " + e.calculate()); x.setArgumentValue(1.5); mXparser.consolePrintln("Res 2: " + " x = " + x.getArgumentValue() + ", " + e.getExpressionString() + " = " + e.calculate()); x.setArgumentValue(2.5); mXparser.consolePrintln("Res 3: " + " x = " + x.getArgumentValue() + ", " + e.getExpressionString() + " = " + e.calculate()); x.setArgumentValue(3.5); mXparser.consolePrintln("Res 4: " + " x = " + x.getArgumentValue() + ", " + e.getExpressionString() + " = " + e.calculate()); x.setArgumentValue(4.5); mXparser.consolePrintln("Res 5: " + " x = " + x.getArgumentValue() + ", " + e.getExpressionString() + " = " + e.calculate()); ```