Share how you use mXparser

If you use mXparser sharing this information is more than welcome 🙂 Please post a comment to that page describing in a few word your use case.


Mariusz Gromada

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

If you found the software useful donation is something you might consider :-)

220 thoughts on “Share how you use mXparser

  1. This parser is great, I am using it to my thesis project where solving user input formulas is the goal.

    Thanks a lot!


      1. Hi Mariusz Gromada,

        I was looking some help to make something like this but not like yours, yours is awesome, I stopped looking any further code. Can I get your permission to use your tool in my project.

        Please send me a confirmation to my email as don't want to violate any copyright law.


        1. Yes you can 🙂 mXparser is distributed under simplified BSD license, it means that you can use it without limitations. The only condition is to put somewhere information that you are using mXparser, i.e. in case you provide license, then please reproduce also license of mXparser.

          Best regards

  2. Mariusz Gromada,

    This parser is awesome! I am using it to finish a capstone class project. The user of my program can enter an equation in many formats. This parser enables me to ignore the headache of parsing the strings myself. It's almost like running the user input as code.

    Thank you!

      1. Hope you may be able to help with this small issue I have had. I am using an array of arguments. When I want to get the value of one argument and return the double I am using getArgumentValue. However, this is returning only an estimate of the argument value.

        For example, argument1 has value 748.429.
        getArgumentValue returns 750.0

        Is there an easier way to get the value to return accurately as a double?

        1. Thank you for your message. Of course I will be happy to help 🙂 I will contact you directly via email.

          Best regards

        2. Issue reported by TW was a consequence of constructor definition. Generally speaking constructor Argument(String argumentName, String argumentExpressionString, PrimitiveElement... elements) should be used for "dependent" argument creation, where argument value depends on the expression provided in argumentExpressionString and optional other arguments, constants, functions given in the variadic PrimitiveElement list. Calling getArgumentValue() method on dependent argument will always call calculate() on the hidden expression, thus if expression is "constant" (no arguments) the value will be always the same. To avoid this situation always carefully choose the constructors, and if still not sure, check argument type calling getArgumentType().

          Thank you for great question and the feedback! 🙂

          Kind regards

          1. Hello!
            I need to show what he thought of the derivative function.
            It's so f (x) = x ^ 3 f (x) '= 3 * x ^ 2. How to do it? Could you help me? Der function (sin (x), x) calculates only. And I need to show the derivative.

    1. Thank you very much for the feedback! I am aware of double disadvantages, but still decided to stick with double as my parser is implemented also in C#/.NET where BigDecimal is not available (or it was not present before). Additionally parser was written from the mathematician point of view. I understand that in case of money calculation it might be an issue. In the next release there will we delivered nice "round" function with "precision" parameter.

      Best regards,

    2. 3.0.0 will bring intelligent automatics ulp rounding, this will minimize issues similar to the 0.1 + 0.1 + 0.1 = 0.30000000000000004

      Nest regards

  3. Hello Mr Gromada, thank you for the useful product you are developing. I wanted to ask whether the parser will support complex numbers, vectors or cubic/quadratic equation solving in the future?
    Thank you very much in advance!

    1. Dear Theme,

      Thank you for your feedback - it is very important to me!

      Regarding complex number - I am thinking about that - it would be great as mXparser supports user defined recursion. Other things like vectors ... we will see.

      Kind regards

  4. I am very thankful for your effort, but:
    1. when I calculate sin(pi), it gave a very small number (order to 10^-16) but not zero
    2. when I install 3.0.0 to my package in xamarin via NuGet, the following error came out:
    Could not install package ' 3.0.0'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

    I will be glad if you can fix that


    1. Dear Nat Chen,

      Thanks a lot for your feedback!

      Referring to the point 1 - I am guessing this is the double precision issue as pi is represented as double number. But yes i can extend sine function definition to check whether argument is equal to numerically defined n*pi then set to 0.

      In case of point 2 - nuget package was prepared targeting .NET framework 4.0 client profile. I assume I should prepare some other version of nuget package?

      Best regards

        1. Dear Nat Chen,

          I need few days to manage that. I know what needs to be done (Portable Class Library for .NET). Initially I tested mXparser for PCL - after few minor changes it worked, but requires some small API changes.

          Best regards

          1. I do think that is a problem of your program setting in NuGet that you say you support Android but not iOS. However, this problem was not happening in 2.4.0 version. Please check. Thanks.

          2. Currently Android is supported only in JAVA library. I am working on the PCL version for .NET - according to Visual Studio PCL will work with Xamarin.

            Best regards

      1. AFAIK, in .NET it should not be so complicated since System.Numerics supports Complex numbers after NET 4.0. If you plan to build the Complex structure from scratch, it will take a lot of time.

        Best Regards!

        1. mXparser provides API for JAVA and .NET - I plan to keep this, so thinking about development I need to consider this.

          Best regards

  5. I am looking into using mxparser into evaluating expression (rules) that match binary expressions in data with is in a Map. So functionally something like map.get('key')[0].equals('something'). Would this be possible with mxparser?

    1. Dear Michel,

      Thank you for your feedback. Can you please provide more details on this specific use case?

      Kind regards

      1. I have Map<String,List> and expressions on that map. The values (typically a list with length 1, can be a string, integer, or even date. What I would like to be happening is defining an expression alike 'property[a] = property[b] && properyty[start-date] >= date-calc[now - day[1]].

        For now I'm taking the approach that I'm parsing the expression above and end up with a math expression that mxparser can handle.

  6. Greetings,
    I am developing an android math application. It will be free. I will, however, put in adverts on the app. I wont alter the code in any way. I only want to use the .jar to parse mathematical expressions. Should I issue out the source code? What do I need to do not to infringe on the license. I looked everywhere for your email and I could not find it.

    1. Hi,
      You can use mXparser without limitations (binary, source, changing source - everything is allowed). You do not need to publish your source code. The only requirement according to the license is to retain / redistribute copyright notice - please follow:

      Best rgards

  7. I'm using it for a calculator and it's great. I would like to indicate some bugs
    Expression relating factorial " ! " cause the application to hang and stop working.
    For example
    A. 5!^2 (where power symbol comes immediately after factorial )
    B. 5!-3 and 5!+3 or similar expressions
    C. 10/5-(5!) and 10/5+(5!) or similar expressions (though 10/5+5! works fine, but when I put brackets around factorial it stops responding )

  8. I made test using Apache POI formula evaluater and mxparser and testing the same expression, the result was that, mxparser was 4 times slower than Apache POI...

    1. Thank you for your opinion. I do not claim mXparser is the fastest. Please check some options that can speed up calculation process:


      Best regards

  9. Hey Mariusz,

    I had a quick query.
    We are planning to use your library in one of our application and while doing the POC, we came across a scenario wherein we are required to validate if the expression is a valid expression (For eg : (2=3) | (2<3) should show as correct but (2=3) | (2<3 should throw an error since the closing bracket is missing. Is there any support for such validation in the library? Also, we need to validate the expression before it is actually executed.

    Thanks in advance!


    1. Hi Melwin,

      This is already supported. Please refer to checkSyntax() and getErrorMessage() in Expression class. Please find below example:

      Expression e = new Expression("(2=3) | (2<3)");
      System.out.println("-------------- Case 1 --------------");
      System.out.println("Syntax : " + e.checkSyntax());
      System.out.println("Message : " + e.getErrorMessage());
      System.out.println("-------------- Case 2 --------------");
      e.setExpressionString("(2=3) | (2<3");
      System.out.println("Syntax : " + e.checkSyntax());
      System.out.println("Message : " + e.getErrorMessage());

      -------------- Case 1 --------------
      Syntax : true
      Message : [(2=3) | (2<3)] checking ...
      [(2=3) | (2<3)] no errors.

      -------------- Case 2 --------------
      Syntax : false
      Message : [(2=3) | (2<3] checking ...
      [(2=3) | (2<3] lexical error

      Encountered "" at line 1, column 12.
      Was expecting one of:
      ")" ...
      "+" ...
      "-" ...
      "*" ...
      "/" ...
      "^" ...
      "%" ...
      "!" ...
      "< " ... "<=" ... ">" ...
      ">=" ...

      [(2=3) | (2<3] errors were found.

      Best regards.

      1. Hey Mariusz,

        Thanks a lot for the reply!

        I have one addition problem as well.

        We have an expression as - IF(arg1="ABC",1,0)

        wherein we need to compare the argument to a String, is this supported?

        I tried writing the expression as ,

        Expression exp = new Expression("if(arg1='ABC',1,0)",arg1);

        (But it didn't work)

        I did try other methods as well, but no success 🙁

        So , is such a comparison supported?

        Thanks again in advance !


          1. Oh! I see. Nonetheless, it's a really good parser and also thank you Mariusz for your super quick responses!

            - Melwin

  10. Hi Mariusz,

    We were using your library to build an expression.
    And we used the checkSyntax() method to validate our expression.

    - We accept the expression from the user Eg : ((_d1+(_d^_g)))
    - Also, we extract the variable name from the expression using getCopyOfInitialTokens() and identify the variables by matching tokens having underscore in the token name
    - Then we assign value to variables and then create an Expression as ,
    Expression ex = new Expression(formula,argumentList.toArray(new Argument[argumentList.size()] ));
    where argumentList is the list of arguments
    - Then we check the syntax of the expression

    So, the issue here is,
    - if the user places an extra parenthesis at the beginning, the getCopyOfInitialTokens() works fine but checkSyntax() gives false
    - however, if the user places an extra parenthesis at the end, the getCopyOfInitialTokens() throws an exception (java.util.EmptyStackException)
    - Unfortunately it is a catch 22 situation, because to check the syntax we need the arguments and to get the arguments we need to use getCopyOfInitialTokens().

    Any help?


    - Akagra

      1. It seems this is related to stack issue. Lexer analysis has to be ok for getCopyOfInitialTokens - i will add checkLexerSytnatx() method.

  11. Hi Mariuz,
    Excellent work, thanks..

    I need to obtain values from a nested sum, is it possible to call an external function (web service) to get this values?

    Constant a = new Constant("w = 3");
    Constant b = new Constant("z = 2");
    Function g = new Function("NR(x,s) = ???"); // matrix values or web service call
    Function f = new Function("NP(x,s) = ???");
    Function i = new Function("f(x,s) = NR(x,s) + NP(x,s)", g, f);
    Function h = new Function("func(s) = (1/z) * sum(x, 1, z, f(x,s))", b, i);
    String expStr = "(1/w) * sum(s, 1, w, func(s))";

    or maybe call a web service and define an array or matrix of arguments...

    Any help ??

  12. Hi Mariuz
    I am loving this so far but, I need a bit of help with something.
    I am trying to make a calculator for Android but I can't figure this out.

    I have a String with the literal expresion to be solved. I'm using the mxparser to solve it but, how can you display the result on the textView?

    1. Hi Darío,

      Assuming you have string s with expression, i.e.:

      String s = "1+2";
      Expression e = new Expression(s);
      String result = Double.toString(e.calculate());

      You can then send result to the textView.

      Best regards

      1. Hi.
        Thanks for attending my Comment.
        I'm getting some errors while trying to run the app.
        The report says:

        -Error:Error converting bytecode to dex:
        Cause: java.lang.RuntimeException: Exception parsing classes

        -Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
        > java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_71\bin\java.exe'' finished with non-zero exit value 1.

        I wrote the method as you said. In case it might help, I'll write it too.
        The operation is in the String named result

        public void solve (View view){
        Expression solution = new Expression(result);
        String finalAnswer = Double.toString(solution.calculate());

        Thanks for your time

  13. Hi Mariusz,

    Thanks for sharing this great library.
    I'm thinking of adopting this library for custom added function parsing tool.
    By the way after I reviewed the API document I couldn't find any aggregate functions which support arguments as a list or array format.
    I'd like to parse the following equation

    eq = abs(max(y)-min(y))

    At this time y is type of array
    Am I missed somthing?

    Thnanks in advance.

        1. If you use JAVA, try this:

          String expression = "max(" + StringUtils.join(array,",") + ")";
          Expression e = new Expression(expression);

          I had the same problem and this works for me.

          Best regards.

  14. Hi Mariusz,

    I have a hash table Map<Object, List> and I need to aggregate each array of Double.

    As a sample, I created a map with one key and an array with 365 values.

    The time to find the maximun among these 365 values is 18 secs.

    Here the code:

    final_map = map_as_list.entrySet()
    Collectors.toMap(entry -> entry.getKey(),
    entry -> {
    List list = entry.getValue().stream()
    Double[] array = list.toArray(new Double[list.size()]);
    String expression = "max"+"(" + StringUtils.join(array,",") + ")";
    Expression e = new Expression(expression);
    double value = e.calculate();
    value = Math.round(value * 1000); value = value / 1000;
    return value;

    How could I increase the performance? Is there a better way to use this library over a hash table?


    Besta Regards,

  15., VS 2012, stepping through the "Hello World!" demo(and my own project) I get the following error "Cannot find Expression.cs". When I let the program run normally, it does function but extremely slow. What is going on?

  16. Hi Mariusz. I have a question. How to shown in the console derivative of the function. Example:
    Input: x ^ 2-4 * sin (x)
    Output in the console: 2 * x-4 * cos (x)

    Here is the code
      public static double derivative (String f, double znach) {
             String znak = Double.toString (znach);
             Argument x = new Argument ( "x =" + znak);
             Expression e = new Expression ( "der (" + f + ", x)", x);
             mXparser.consolePrintln ( "Res:" + e.getExpressionString () + "=" + e.calculate ());
             return e.calculate ();

  17. Hi, Mariusz

    Thanks for your great parser! I have used it in Jdeveloper IDE - all work fine. Today I have tried the same code in Eclipse IDE.
    import org.mariuszgromada.math.mxparser.Expression;
    public class CalculatorImpl {
    Expression e = new Expression("2+2");

    And eclipse hightlight constructor - "The constructor Expression(String) is undefined"
    Could you help me?

    1. Hi,

      Thanks for sharing opinion! 🙂 In case of your problem - looks like IDE issue. Have you been trying to recreate / refresh the project?

      Best regards

  18. Hi Mariusz,
    I have a query regarding the usage of mxparser. We need a parser which works for both dotnet and objective-c. I know mxparser works for dotnet provide.
    Let us know whether mxparser supports objective-c.
    I do not see documentation for objective-c.

    Best Regards,

    1. Hi,

      Unfortunately Objective-C is not supported. Library binaries are provided for JAVA and .NET/MON, including Xamarin.iOS. The only option to use mXparser on iOS is through JAVA or MONO (MONO meaning Xamarin.iOS).

      Best regards

  19. Hi Mariusz,

    first: thanks for this great library! It is nearly perfect!
    second: I have a problem with the following expression:

    Expression ex = new Expression("1-0200"); //=-199 // problem with preceding zero

    In version 3 of your library everything runs fine and syntax was correct; after upgrading to your latest version the method checkSyntax returns false. I ran threw your sourcecode, but I can't figure out the position which I have to change.
    Do you have any idea where I have to look or what I have to change?


    1. Hi Theodor,

      Thanks for your feedback. Indeed i changed the grammar cleaning some patterns in regular expression. This is impossible to reverse without JavaCC. Please let me know your use case, why you need this leading '0' - If you have reasonable arguments I may consider allowing leading zeros.

      Best regards

  20. Hi Mariusz

    Can I use the "AND" operator except for the operators "&", "&&", "/ \\" .
    for example: Expression e = new Expression(" 3+2=10") ;
    I've tried to change boolean operator && on a "AND" but don't this work.


    1. Hi Petr,

      Currently unfortunately not. But still you have 3 additional tokens for boolean AND operation.

      Best regards

  21. The parser is truly amazing, it's exactly what I needed! I was just wondering if there was a way to represent large numbers in a normal decimal form rather than in a scientific form when doing calculations?

    1. Thx Anon for your feedback 🙂 It is really important to me 🙂

      In terms of very large numbers, in upcoming mXparser v.4.1 "Aeries" you will get full support for scientific notations + other numeral systems with different bases.

      Referring to your problem - you always can input very large numbers directly (without scientific notation), but the output is always type double. In v.4.1 I will introduce some simple / nice function to format double as string, but still double will have its own limitation regarding numbers representation (meaning loosing precision on very huge numbers).

      Best regards

      1. Thanks for the reply, secondly one of the other issues is that a string like "3pi" will evaluate to NaN, instead of 3*pi. This goes for all other symbols and functions too, ie, "5sin(50)" evaluates to NaN. Can you also please address this in your update?

        Lastly I've noticed that Logs and natural Logs of powers of multiples of 3 do not evaluate to precise numbers. ie, Log(1000) is 2.99999998 instead of 3, and Ln(e^6) is 5.999998 instead of 6.

        Best Regards

        1. "3pi" this is implicit multiplication, currently this is syntax error. I have doubts with introducing implicit multiplication... as this might be confusing. Byt will think on that.

          Can you let me know what framework are you using (java, .net, ...)? mXparser is for numerical computation, not symbolical, and this small "rounding" error might occur. For java "ln(e^6)" gives perfect 6.0

          Best regards

          1. I'm using Java,
            This is my code:
            Expression e = new Expression("log(10,1000)");
            String ms = String.valueOf(e.calculate());
            The output is 2.9999999999998

    1. Hi,

      Thank you for this feedback - I am very happy mXparser helped 🙂 Thank you for sharing the links!

      Kind regards,

  22. Hi Mariusz,
    I'm developing in VB.Net and testing mXparser. I always get the following error when I try to evaluate a simple formula.

    "System.IO.IOException" in mxparser.dll

    The error occurs 4 times for every formula. I use the following code:

    Imports org.mariuszgromada.math.mxparser
    Public Function Evaluate(ByVal pstrFormula As String) As String
    Dim oExpression As Expression
    Dim dblExpression As Double
    oExpression = New Expression(pstrFormula)
    dblResult = oExpression.calculate()

    pstrFormula can be any formula, like "1+2".

    Seems straightforward, but at the last line I get the error 4 times.

    Do you see anything I'm doing wrong here?

    Thank you,

      1. This works fine:

        Imports org.mariuszgromada.math.mxparser

        Module Module1

        Public Function Evaluate(ByVal pstrFormula As String) As Double

        Dim oExpression As Expression
        Dim dblResult As Double
        oExpression = New Expression(pstrFormula)
        dblResult = oExpression.calculate()
        Return dblResult

        End Function

        Sub Main()


        End Sub

        End Module

        1. Hi Mariusz,

          thank you for your answer!

          As far as I can see your solution, starting with "Dim oExpression As Expression", is exactly what I'm doing. And yes: after "dblResult = oExpression.calculate()" the correct result is stored in "dblResult".

          But nevertheless the error "System.IO.IOException in mxparser.dll" is thrown 4 times at that line. I see it in the debugging window when I step through the code. So I think, if I'm not doing anything wrong, there must be a reason why mXparser throws that error. Even if it returns the correct result.

          Aside from this error: as far as I can see mXparser is a very fine peace of work. Thank you!


    1. This is not a bug, this is the way how JavaCC was designed, and then ported to C#. In auto-generated code of the parser the throwing / catching System.IO.IOException is very common.

      The impact on the performance might be only in DEBUG mode, but still very limited, as you can use "Just My Code" option.

  23. Hi Mariusz,

    Can you please help me ? I need to create functions, for example:

    highest(volume,3) : return the highests 3 values stored in a XML file.

    If the user enter highest(volume,3) in the system, the program need to identify this function. Can you please tell me if this is possible with mXparser ?

    Greetings from Brazil!

    1. Hi Phelipe,

      This is possible. You have to implement FunctionExtension interface to read the value from XML file. Then using implemented FunctionExtension you are just creating user defined function. Plese refer to the example #5 "Case 5: Implementing your own Function Extension" in "User defined functions" section of mXparser tutorial.

      If this helps - please start the repo in GitHub 🙂

      Best regards from Poland (currently on vacation in Spain - Canary Islands)

  24. Hi Mariusz,
    Can you please help me ? I need to get g(x) from f(x)=0.
    For example
    f(x) = x^2 − x − 2 = 0,
    g(x) = x^2 − 2,
    g(x) = 1 + 2/x,
    g(x) = (x^2 + 2)/(2*x − 1)

    g(x) actually what is x

    1. Hi,

      I think I do not understand your question... Is the question about mXparser? It is not clear what your are trying to solve.

      Best regards

  25. Hi Mariusz

    I'm also getting the IO Exception every time I calculate. (Same as Anders 1 August 2017)

    The answer is correct but the throwing and catching of the exception causes the system to run quite slowly especially if I'm doing a large number of calculations.

    I'm using version 4.1

    1. Further investigation into the source code, I have found that the exception is coming from the SyntaxCheckerTokenManager.

      Its trying to call BeginToken on the input_stream but it has been disposed and thus will throw an exception and in the catch statement handle the defaulting etc.

      Though this is quite unnoticeable when calling calculate() once. It has a tremendous impact on performance if you are using the parser to calculate numerous times.

    2. This is not a bug, this is the way how JavaCC was designed, and then ported to C#. In auto-generated code of the parser the throwing / catching System.IO.IOException is very common.

      The impact on the performance might be only in DEBUG mode, but still very limited, as you can use "Just My Code" option.

  26. Hi Mariusz, Could you please explain, why does this expression give an error?
    Time to time I may have variables with leading zeros, and this is what I got:
    [1000+0001000] checking ...
    [1000+0001000] lexical error

    Encountered " "0 "" at line 1, column 7.

  27. Hi Mariusz,

    Is this parser is compatible with .net core 2. When the expression "if(sum(1,0,0,0,0) = 0,1,0) +if(sum(1,0,0,0,0) = 1,3,0) + if(sum(1,0,0,0,0) > 1,10,0)" it return NaN

  28. Hi Mariusz,

    I would like to thank you first for the wonderful tool!

    One question: Can I change from rad to deg at the angle functions like sin (). I would like to write sin (45) and not sin (45 * [deg])

  29. Hi Mariusz,

    How can I use the derived functions to

    Dim e As Expression = New Expression("cos(1) - der(sin(x), x, 1)")
    Console.WriteLine("Res: " + e.getExpressionString() + " = " + e.calculate())

    Error: System.InvalidCastException: "Bringing the string" Res: cos (1) - der (sin (x), x, 1) "to the" Double "type is invalid."

    1. In you need to add ToString() to cast double to string

      Dim e As Expression = New Expression("cos(1) - der(sin(x), x, 1)")
      Console.WriteLine("Res: " + e.getExpressionString() + " = " + e.calculate().ToString())

        1. mXparser always returns double. You need to cast / convert to decimal. If you want such a big precision pls also use mXparser.setEpsilon(0)

  30. Hi,

    How do I show the equation or expression of math in my android . do we have any separate view or how?.. Iam developing an application of maths which we will show the questions and options as objective Q&A test. So how do I use This to show in my applilcation. If now can we use with webView ..(Suggest Plz..) thanks...

  31. Hello Mariusz,
    I'm a little confused. I wrote a Comment a few hours before and I thought I had made an error. I couldnt see it. So I wrote a new Comment now. But now there is my formerly comment. Whats going on??
    But no matter ....

    Best regards

  32. I've built up an management indicators app (java + angular web app) with you package (to help managing the university where I work in Brazil). Amazing work!!!

    Unfortunately the app is protected by login and password so I cannot share with you.

    1. Thx for the feedback 🙂 You can still share the app name and description 🙂

      If you like the package github star would be nice 🙂

      Best regards

  33. Mariusz, is "prod" a reserved word in mxparser? I tried to create a formula using this string with a parameter and it mark it as invalid. Well, if so, where can I get a list of the reserved words in mxparser?

    1. Yes, this is built-in keyword for product iterated operator. But you cna easily change it - there is an option for that.


      mXparser.modifyBuiltinToken(String currentToken, String newToken)
      mXparser.modifyBuiltinToken(String currentToken, String newToken, String newTokenDescription)
      mXparser.unmodifyBuiltinTokens(String... currentOrNewTokens)

      mXparser.removeBuiltinTokens(String... tokens)
      mXparser.unremoveBuiltinTokens(String... tokens)

      Best regards

  34. Great Work Mariusz !

    Is there way in this library to replace patterns such as (#1 * #2)/#3
    when passed a Map ("1",25) ("2",2) ("3",10) should return 5


    1. Why not to use arguments?

      Argument x1 = new Argument("x1");
      Argument x2 = new Argument("x2");
      Argument x3 = new Argument("x3");
      Expression e = new Expression("(x1 * x2)/x3", x1, x2, x3);

      [mXparser-v.4.2.0] 5.0
      [mXparser-v.4.2.0] 4.0

      The other option is via function, i.e.

      Function f = new Function("f(x1, x2, x3) = (x1 * x2) / x3");
      mXparser.consolePrintln(f.calculate(25, 2, 10));
      mXparser.consolePrintln(f.calculate(20, 2, 10));

      [mXparser-v.4.2.0] 5.0
      [mXparser-v.4.2.0] 4.0

      Bes regards

  35. Great product Mariusz!

    I am wrapping mXparser (Java version) with restful web service code to create "calculation services". These can be accessed by other applications or standalone, with a web browser or http requesting tool. I work for a scientific laboratory and by using this I can pull all the calculations out of the code of the various existing applications and put them all in one place for auditing and cataloging purposes.

    So far it is working great and I really like it. I did encounter an issue when working with very small (and probably very large numbers), however. If I run this Java code, using ordinary Java double's (not even BigDecimal's):
    double ad1 = 2500;
    double ad2 = 1.0013826583317465947599675784203E-15;
    double ad3 = 30;
    double ad4 = 35;
    double ad5 = 40;
    double ad6 = 1;
    System.out.println("ad2 = " + ad2);
    double calc = ((ad1 * ad2) / (ad3 * ad4 * ad5 * ad6));
    System.out.println("calc = " + calc);

    As expected, I get this output:
    ad2 = 1.0013826583317466E-15
    calc = 5.960611061498491E-17

    However, when I try to do the same thing in mXparser:
    Function function = new Function("S(a1,a2,a3,a4,a5,a6) = (a1 * a2) / (a3 * a4 * a5 * a6)");
    Expression expression = new Expression("S(a1,a2,a3,a4,a5,a6)", function);
    Argument a1 = new Argument("a1 = " + ad1);
    Argument a2 = new Argument("a2 = " + ad2);
    Argument a3 = new Argument("a3 = " + ad3);
    Argument a4 = new Argument("a4 = " + ad4);
    Argument a5 = new Argument("a5 = " + ad5);
    Argument a6 = new Argument("a6 = " + ad6);
    expression.addArguments(a1, a2, a3, a4, a5, a6);
    System.out.println("mxParser result = " + expression.calculate());

    I get zero back:
    mxParser result = 0.0

    Am I using mxParser correctly or is this a limitation? It seems like it should be able to handle these numbers, especially since the top code works with Java doubles.

    Thanks very much,

      1. Hi Mariusz,
        Thanks very much for your reply. What you gave me didn't work but when I switched it to this:


        It works. Thanks very much!


  36. Hi Mariusz,

    I need some help regarding the usage of the mXparser.
    I would like to use it with mingw compiler (gcc (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 5.3.0) .
    My question is where can I find the appropriate lib dll and header files for build the mXparser into my project?

    Thanks in advance.
    Best regards,

  37. Hello Mr Gromada, thank you for the useful product you are developing.
    I wanted to ask how can i solve 3(x-5)=2x+6 with mxparser in android?

    Expression d = new Expression("solve(3*(x-5)=2*x+6)");
    double c = d.calculate();
    Toast.makeText(getApplicationContext(),"Solution "+c, Toast.LENGTH_LONG).show();

    The code above did not worked.

      1. If you want to solve f(x)=0 please use
        solve( f(x), x, a, b)

        where x is argument, [a,b] is the interval where the root is.

        This is numerical solve, so you need to give a and b. In your case
        solve( 3*(x-5) - (2*x+6) , x, -100, 100)

        should work 🙂

  38. Hi. I wanted to ask a question. I have a list of arguments. Is there any option that we could populate a dictionary with all the possible arguments and the parser could then evaluate the algebraic expression based on the values in the dictionary. (My list of arguments are user defined. I cannot hard code.) Thanks.

      1. What if the number of arguments are different after each instance.
        i.e. For first time: x,y,z
        For Second time: r,t,y

  39. Hi, could you upload a version 4.1.x which has checkSyntax() method in Function working. Non of currently uploaded version on maven central have this method working and I've seen that bug has been fixed on gitHub in one of recent commits. Thank you!

    1. Yes, I have a plan for that. But this will be 4.2, not 4.1, as the change was made only in 4.2 src.

  40. Hi,
    Do you have any plants to support vector/arrays?

    I means that an expression will get nXm (n arguments for m different calculation)
    and return double[] of m answers?

  41. Hi Mariusz,
    I am writing program in C# using your library but I have problem with n-th derivative.


    Argument x = new Argument("x", 2);
    Expression e = new Expression("dern(x^3, 2, x)",x);
    mXparser.consolePrintln("e: " + e.calculate());

    [mXparser-v.4.1.1] e: -8.796093022208E+16

    As you can see the result incorrect.
    Could you kindly tell me where I am making a mistake?

    1. I suppose there is a bug in dern operator, for second derivative you can use this one

      Argument x = new Argument("x = 2");
      Expression e = new Expression("der( der(x^3, x), x)", x);

  42. hello
    im a beginner developer
    im developing a scientific calculator android app for practice
    as i found making a regular one so easy

    i made a code that parse some of regular expressions
    but i want more and it takes me too much time for it

    i dont know how to impliment this program
    can somebody help

    and thank you for making this program it looks to me its very helpful
    though i need help in how to use it in android studio
    as i said im beginner

  43. How can i evaluate ((STC-1 != WTC-3 || STC-1!= STC-1) || 9<= 8).
    Here STC-1 and WTC-3 is a string.

    PLease help.

  44. I would like to evaluate (STC-1 != WTC-3 || STC-1!= STC-1) || 9<= 8), but the problem here is the string part STC-1 and WTC-3 are string. I am not getting desired output.
    Please help.

  45. I'm writing a virtual reality tool for data visualization and modeling, and needed an equation parser for comparing functions to data. This was just what I was looking for, and was drag and drop implementation into my Unity project. I really appreciate the C# support!

  46. Hey Mariusz,

    its possible to evaluate "nested" expressions?

    Like the following:

    var weightArgument = new Argument("Weight", "Length * Height");

    var result = new Expression("Amount*Price*Weight", constAmount, constPrice);

    If I like to get ExpressionString I ike to get:

    Amount * Price * (Length * Height)

    Is this possible?

    Thanks 🙂

    1. Sure - see the code

      var lengthArgument = new Argument("Length = 2");
      var heightArgument = new Argument("Height = 3");
      var weightArgument = new Argument("Weight = Length * Height", lengthArgument, heightArgument);
      var constAmount = new Constant("Amount = 4");
      var constPrice = new Constant("Price = 5");
      var result = new Expression("Amount * Price * Weight", constAmount, constPrice, weightArgument);

      Best regards

      1. Hi Mariusz, thanks for your answer 🙂

        Yes I already know that I am able to calculate this.

        But my wish is for info purposes to display the full formula.

        I like to modulize it in code, but print all nested "variables".

        Its about: getExpressionString()..

        It shouldn't display Amount * Price * Weight.
        It should display Amount * Price * (Length * Height) (Brackets are optional)

        So. Automatically replace expression for Weight with given Argument.

        You got? 😮 I saw in hidden properties, that there is a relation. I could build it by myself in my code, but I like to be ready for updates and I think it could help other people also.

  47. no soy mucho de usar java.... pero estaba probando tu programa con ANDROID STUDIO, me parece genial tu mXparser, realiza un sin fin de cosas. pero me parece que debes de solucionar lo siguiente:

    -b+5 (OK)

    EL SIGNO "+" al principio de una variable provoca un cuelgue... pruebalo y me comentas

  48. Hi Mariusz,

    I'm working on a virtual reality calculus educational app. I'm working with Unity and C#. I am trying to be able to graph implicit equations, i.e. "x^2+y^2+z^2-4=0". My question is, if that was the equation that is input, how could I create a new function with everything but the "=0". I need to be able to evaluate that function to see whether the value is +/-.


    1. Hi Randal,

      Can you clarify a bit? "x^2+y^2+z^2-4=0" is the string provided by the end user? Does it always end with "=0"? There are many option to do that. Pls send more info and I will prepare a code snippet 🙂

      Best regards,

      1. Mariusz,

        That is correct, the string will be input from the end user in that form. That is the most basic form of an implicit function. It will always end in "=0".

        Thank you

        1. Randal,

          I assume you want to evaluate z = f(x,y), so that f(x,y) - z = 0. I understand it might be impossible to ask user for the f(x,y), as in many cases finding f(x,y) might be hard. You just want an equation for the surface.

          One possible approach is to set x and y values then solve numerically f(x,y) - z = 0 for argument 'z'. Here we have few risks:
          - there is not solution
          - solution is not unique

          But in general it will work.

          mXparser provides 'solve' function - I can prepare a code showing how to do that.

          In case when it is possible to ask the user for f(x,y) such that z = f(x,y) the whole issue is a lot easier.

          Best regards,

          1. I have been trying to post a question for a while but am not seeing it being displayed so i will try and ask here.
            Please, how do i implement - cuberoot(27) - is there a function for this?
            Its urgent please.
            Thank you.

  49. I need some more information on how I can implement 3√27 which is the cube root of 27.
    I check all the tutorials couldn't find it

  50. Please, how do you implement, cuberoot - I have been going about it for days now.. I have used cbrt(27), 3sqrt(27) or doesnt the parser support cuberoot??

  51. Hello Mariusz,

    Thank you very much for the greate library. I am using it for claculating simple formulas, in a a way that the user defines some parameters and writes the formula, and my application calculates it using mXparser.
    Now I noticed -as the library is very powerful-, the user cannot define a parameter named "e"! I was wondering if it is possible to limit the library to simple basic math.

    Thank you very much,

    1. Hi,

      Thanks for your feedback. Please use below option


      It will trigger the behavior you expect, meaning keywords provided by the user will have priority.

      If you just want to remove some keywords for the parser please use

      mXparser.removeBuiltinTokens(list of tokens);

      Please verify documentation.

      Best regards,

  52. Hello Mariusz,
    Thank you very much for you powerful math library.
    We are using it very often for complex Problems.
    Unfortunately i have a Problem with the Digits.
    When I use the e1.calcuate() function the double value it
    Returns "only" has 14 after comma Digits.
    When i calculate the same Expression in matlab i get 16 after comma Digits.
    Is that a C#.toString Problem or where do i lose the precision?

    Thank you very much.

    1. Tank you. Pls change the optipns. mXparser.disableUlpRounding()
      Jest regards

  53. Hi,

    Thank you for this great library.

    I'm using this library to make an Android app. It is available in the Google Play store. (CalcMat). Hope you will get happy seeing that your library is put to good use.

    I have a question too.

    How can i reduce the number of digits in the answer.?

    Currently i get 16 digits after the decimal point. i want it to reduce to 12.

    How can i do that?

    Thank you

  54. Hi Mariusz,

    Thanks for sharing this powerful library with us.

    I'm just wondering if you have a NuGet package that does not include the docs folder.

    Thank you,


  55. Hi Mariusz,

    Thank you very much for the library.
    I'm using your library for calculation and also for checking if the string representation of the formula is correct. But for formulas "+2+3" and "2+3+" I got 'true' from checkSyntax() function.

    Best Regards,

  56. Hi, I installed the library using NugetPackage but when typing "using org. ... " it doesnt exist. Dont know whats the problem. Do i need to install something additionally ?

    Using VS 2015 coding android app with xamarin

  57. Hi,
    First of all, You All did a great work in MXParser, Thanks for this,
    I have a query, do we support underscore in number? As it is supported in java 7.
    Like if we have expression like ".2/2.0+3-1*(5_000_000-3) + 7^2" then google calculates it properly. but with mxparser we are getting NAN as result.

  58. Hello,
    It is my first time using mXparser. I want to solve the equation: "x*tan(x) = y".
    So i'll give a value to y argument and I want to get the multiples values of x.
    Is this possible through mXparser?
    Thank you in advance for your time.

    1. Hi,
      Please use "solve" functions, sample code below:

      Argument y = new Argument("y = 5");
      Expression e = new Expression("solve(x*tan(x) - y, x, -pi/2, pi/2)", y);
      mXparser.consolePrintln(y.getArgumentName() + " = " + y.getArgumentValue());
      mXparser.consolePrintln(e.getExpressionString() + " = " + e.calculate());

      [mXparser-v.4.3.0] y = 5.0
      [mXparser-v.4.3.0] solve(x*tan(x) - y, x, -pi/2, pi/2) = 1.31383772
      [mXparser-v.4.3.0] Help content:

      # key word type syntax since description
      - -------- ---- ------ ----- -----------
      223. solve solve( expr, a, b ) 4.0 f(x) = 0 equation solving, function root finding

      Best regards

  59. Fantastic library! Thank you!

    I'm writing an OBD2 library for car research, but have a small problem. It seems like the variable name C doesn't work, always returns NaN. Is this intentional?

    Argument C = new Argument("C", 0x7A);
    Expression e = new Expression("(C-40)/2", C);
    mXparser.consolePrintln("Res 1C: " + e.getExpressionString() + " = " + e.calculate());


    [mXparser-v.4.2.0] Res 1C: (C-40)/2 = NaN

    Replacing that with A or B or D or X or Y all works:

    [mXparser-v.4.2.0] Res 1D: (D-40)/2 = 41.0

    Any idea?

    1. Thank You!

      You are trying to use reserved built-in keyword - 'C' is Binomial coefficient with syntax 'C(n,k)', please see the code below:

      Argument C = new Argument("C", 0x7A);
      Expression e = new Expression("(C-40)/2", C);
      mXparser.consolePrintln("Res 1C: " + e.getExpressionString() + " = " + e.calculate());


      [mXparser-v.4.3.0] Res 1C: (C-40)/2 = NaN
      [mXparser-v.4.3.0] false
      [mXparser-v.4.3.0] [(C-40)/2] checking ...
      [(C-40)/2] (C) Duplicated .
      [(C-40)/2] (C, 1) expecting 2 arguments.
      [(C-40)/2] errors were found.

      You can easily fix that problem by setting the override built-in tokens option, please refer to the below code:

      Argument C = new Argument("C", 0x7A);
      Expression e = new Expression("(C-40)/2", C);
      mXparser.consolePrintln("Res 1C: " + e.getExpressionString() + " = " + e.calculate());


      [mXparser-v.4.3.0] Res 1C: (C-40)/2 = 41.0
      [mXparser-v.4.3.0] true
      [mXparser-v.4.3.0] [(C-40)/2] already checked - no errors!

      Best regards,

  60. Hi Mariusz ,

    I was wondering if it is possible to write the formulas in other cultures. For example, having comma as the floating point seperator: 2,5 instead of 2.5.


        1. But ... there is a possible workaround as mXparser provides additional function parameters separator - semicolon ';'

          While you make sure that users will use ';' instead ',' in functions then you can use a trick 🙂 Please see the example below

          String expStr = "2 + 3,2 - 2,3e10 + log(2;8)";
          Expression exp = new Expression(expStr.replace(',', '.'));

          Best regards

          1. Oh! It seems that I have missed your reply!
            Thank you for thinking about it, and for the workaround suggestion. I solved it in a similar way.


            P.S.: I wish you a happy new year : )

  61. Great library, was writing something like this, but yours is much better.

    Question on using the solver. When there are multiple solutions, it seems that it randomly gives one of the possible answers.

    Is there a way to make that systematic (like 1st answer from left to right), so I can have my software continue through the domain to find other possible solutions



    Expression eee = new Expression("solve(x^2+7.5*x-70.2,x,-100,100)");
    mXparser.consolePrintln("Res. : " + eee.getExpressionString() + " = " + eee.calculate() );

    Called three times gives:
    EVALUATE: solve( x^2+7.5*x-70.2, x, 100, -100) = -12.92946077
    EVALUATE: solve( x^2+7.5*x-70.2, x, 100, -100) = 5.42946077
    EVALUATE: solve( x^2+7.5*x-70.2, x, 100, -100) = 5.42946077

    Thanks for considering


  62. Hi Can the Arguments be generated dynamically like below?

    foreach (KeyValuePair variable in VariableDictionary) {

    Argument x = new Argument(variable.Key + "=" + variable.Value);

    if its possible how can they be used individually in Expression?

    Expression e = new Expresssion("SOMEEXP", ????)

  63. Hi Mariusz ,
    I need to iterate through an array of number, pass it to a function and find the maximum number that came out of it. Do you have any idea how to solve this?

    double[] factors = {0.5, 0.4, 0.3};
    Argument arg = new Argument("arg", "max(f(iterate_factor));

    Tried with the maxi, but maxi only iterates through fix number.

    1. Hi Bryan,

      There is a simple solution of your problem. You just need to implemented FunctionExtension interface - it is basically an option to create user defined function based on your java/.net implementation. Please find the code below.

      Factor class get double[] as parameter. Function "factor" based on Factor class returns
      factor(0) = length of an array passed in the constructor
      factor(n) = array[n-1] for n

      class Factor implements FunctionExtension {

      double[] factors;
      int index;

      Factor(double[] factors) {
      this.factors = factors;
      index = -1;

      public int getParametersNumber() {
      return 1;

      public void setParameterValue(int parameterIndex, double parameterValue) {
      if (parameterIndex == 0) index = (int)parameterValue;

      public String getParameterName(int parameterIndex) {
      if (parameterIndex == 0) return "index";
      return "";

      public double calculate() {
      if (factors == null) return Double.NaN;
      if (factors.length == 0) return Double.NaN;
      if (index < 0) return Double.NaN; if (index > factors.length) return Double.NaN;
      if (index == 0) return factors.length;
      return factors[index-1];

      public FunctionExtension clone() {
      return this;


      And then function usage

      double[] factors = {0.5, 0.4, 0.3};
      Function factor = new Function("factor", new Factor(factors));
      Function f = new Function("f(x) = x^2");
      Expression e = new Expression("maxi( i, 1, factor(0), f(factor(i)) )", f, factor);

      + result:

      [mXparser-v.4.3.0] 0.25

      Best regards

      1. Hi Mariusz,
        Super, it works great for me now. I have just one more question, is supporting BigDecimal is something that is on the roadmap of MXParser ?

        1. Hi Bryan,
          I am happy that t works. mXparser is flexible 🙂
          In terms of BigDecimal – this is completely different story – currently there is no roadmap for that. It would require complete rewrite of the math libraries, as mXparser is based on the standard Math library. A lot of math functions are not present in BigDecimal.
          The other issue is the problem to keep the same API for .NET and JAVA – mXparser currently supports exactly the same API for .NET and JAVA. There is no BigDecimal in .NET
          Best regards

  64. Hi,
    First of all thanks for this fantastic library.
    iam experimenting this parser, is it possible to return array ? i see calculate function is returning computer double vale. is there support to return array.
    Say i need to retun TopN numbers from the given input. It the input list is {70,20,40,80} and the for Top2 i need to return {80,70}

    1. Hi,

      mXparser does not support array as return type. You can still solve your problem pretty easily, just use user defined variadic function with 'par' token

      f(...) =
      par(n) - returns parameter value at 'n'
      par(0) - returns parameters number
      [npar] - the same as par(0)

      See the below example, that solves your problem by returning n-th number from provided list. Just make a loop and create array later on

      Function f = new Function("f(...) = par( par(1)+1 )");

      Expression e1 = new Expression("f(1, 10, 20, 30, 40)", f);
      Expression e2 = new Expression("f(2, 10, 20, 30, 40)", f);
      Expression e3 = new Expression("f(3, 10, 20, 30, 40)", f);
      Expression e4 = new Expression("f(4, 10, 20, 30, 40)", f);


      mXparser.consolePrintln(f.calculate(1, 100, 200, 300, 400));
      mXparser.consolePrintln(f.calculate(2, 100, 200, 300, 400));
      mXparser.consolePrintln(f.calculate(3, 100, 200, 300, 400));
      mXparser.consolePrintln(f.calculate(4, 100, 200, 300, 400));

      [mXparser-v.4.3.0] 10.0
      [mXparser-v.4.3.0] 20.0
      [mXparser-v.4.3.0] 30.0
      [mXparser-v.4.3.0] 40.0
      [mXparser-v.4.3.0] 100.0
      [mXparser-v.4.3.0] 200.0
      [mXparser-v.4.3.0] 300.0
      [mXparser-v.4.3.0] 400.0

      Argument i = new Argument("i");
      Expression e = new Expression("f(i, 10, 20, 30, 40, 50, 60, 70, 80)", f, i);

      int n = 3;
      double[] topn = new double[n];
      for (int j = 0; j < n; j++) { i.setArgumentValue(j+1); topn[j] = e.calculate(); } for (double v : topn) mXparser.consolePrint(v + ", "); Result: [mXparser-v.4.3.0] 10.0, 20.0, 30.0, Best regards

      1. Hi Mariuz,
        Thanks for the quick response.
        Iam trying to find solution for this
        Expression e = new Expression("add(tee1,tee2)");
        e.defineArgument("tee1", 70);
        e.defineArgument("tee2", 80);
        e.calculate(); //prints 150.0

        but it it is

        Expression e = new Expression("add(1,2)");
        e.defineArgument("1", 70);
        e.defineArgument("2", 80);
        e.calculate(); //prints NAN . It is not working
        Here 1 and 2 are the ids whose values are 70 and 80 ..
        If the arguments are numbers then it is not working...

        Need your help on this


  65. Hi Mariuz,

    We used Expression
    Expression e = new Expression("add(tee1,tee2)");
    e.defineArgument("tee1", 70); e.defineArgument("tee2", 80);
    e.calculate(); //prints 150.0

    but can we use the expression arguments as Integers
    Expression e = new Expression("add(1,2)");
    e.defineArgument("1", 70); e.defineArgument("2", 80);
    e.calculate(); //prints NAN . It is not working

    because 1 and 2 are ids that will be replaced by their actual values.
    Any workaround for this?

  66. Hello everyone!

    I´m looking for a way to simplify expressions like:
    1) sum(x+5,x+2) = 2x+7
    2) sum( x+5, min(2,x+7)) = min(x+7,2x+12)

    The goal is to have a set of inequalities at the end of the day. So we dont know the actual value of x at any time.

    Is there a way to work with variables without defining actual arguments for them?

  67. Hello Marius,
    mXparser is a great achievement and I am very interested in using it.
    However, I have a problem that I am not able to resolve and I hope you can help.
    First of all I would like to use your parser in a WPF project so I started a simple c# project with a window, a button, one text box to display the result of the calculation. Then I copied and pasted your examples into the button code and replaced the console output with the proper reference to the output textbox.
    The code of Hello World worked fine however It didn't with others. It seems that the problem is the keyword "Expression" that leads to this error:

    Error CS0104 'Expression' is an ambiguous reference between 'System.Windows.Expression' and 'org.mariuszgromada.math.mxparser.Expression'

    Copy&Paste of all the examples in a console application worked fine.

    An additional note : will be great to have the code examples in visual basic as per Hello World.

    Thanks for your help.
    Best Regards,
    Maurizio Verri

    1. It seems like you have both System.Linq.Expressions and org.mariuszgromada.math.mxparser in usings and Expression is ambigous. Remove System.Linq.Expressions if it unnecessary or reference explicitly org.mariuszgromada.math.mxparser.Expression or use alias using Expression = org.mariuszgromada.math.mxparser.Expression

  68. Hi Mariusz. Many thanks for creating, supporting and improving mXparser. It’s a terrific resource!

    Perhaps I’m missing something obvious, but I’m getting unexpected results using mXparser (v4.3.3) in a C# / .NET Core UWP (v6.2.8) project. A simple two-argument expression seems to work just fine, as below:

    Argument A = new Argument($"A = 1");
    Argument B = new Argument($"B = 2");

    expression = new Expression( $"B - A", A, B );

    result = expression.calculate();

    // Successful result
    // expression.errorMessage = "[B - A] checking ...\n[B - A] no errors.\n"

    However, the calculation returns an error in a simple three-argument expression:

    Argument A = new Argument($"A = 1");
    Argument B = new Argument($"B = 2");
    Argument C = new Argument($"C = 3");

    expression = new Expression( $"C - B - A", A, B, C );

    result = expression.calculate();

    // Error result
    // expression.errorMessage = "[C - B - A] checking ...\n[C - B - A] (C) Duplicated .\n[C - B - A] (C, 0) expecting 2 arguments.\n[C - B - A] errors were found.\nProblem with expression syntax\n"

    The really strange thing is that when I run the same three-argument expression using argument names shown in the online tutorial ("User defined arguments"), the calculation is successful:

    Argument x = new Argument($"x = 1");
    Argument y = new Argument($"y = 2");
    Argument z = new Argument($"z = 3");

    expression = new Expression( $"z - y - x", x, y, z );

    result = expression.calculate();

    // Successful result
    // expression.errorMessage = "[z - y - x] checking ...\n[z - y - x] no errors.\n"

    Not sure what’s happening here. I don’t see any restrictions in argument naming in the documentation. What am I missing? Is this behavior explained in the documentation?

    Ultimately, I’d like to build fairly simple expressions of up five arguments using argument names A, B, C, D, and E. Is this possible?

    Many thanks…Dan Meier

    1. Dear Dan, thank you. You are using "C" keyword, which is as built in one for combinations. At the very begging please add this code: mXparser.setToOverrideBuiltinTokens()

      Best regards

  69. i am using the parser in app Inventor for android. unfortunately i found that number < 10e-13 are equal 0
    for example 1e-7^2 =0 in display but internally it still works. how can i use scientific notation in app inventor?

  70. i use the great xparser in the app inventor but find issues when numbers are less 1e-14. in that case the result is ZERO.
    also i am not clear if the user defined constants are defined in that android developer.
    for example
    gives NaN


Leave a Reply

Your email address will not be published. Required fields are marked *