PackageTrack
Sign in Get early access

math_parser

Process math expressions, like formulas or parts of equations, convert them to machine-readable form, and calculate them.

1.5.2 10K downloads/mo #2889 most downloaded on pub.dev Sominemo/Math-Parser-Dart

What this package is like to depend on

Last release 1 years ago

30 Apr 2025

Release timing varies

gaps range from 8 days to 2.0 years

Nearly every release is documented

notes for 8 of 8 stable releases

1 version withdrawn

withdrawn after publishing

5 years old

9 releases · first in 2021

0 releases in the last 12 months

see the full history below

Release timeline

9 releases · Nov 2021 to Apr 2025
2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 9
  1. 1.5.2 30 Apr 2025
    Release notes
    • Added MathComparison.evaluate() - by jersonal-com
    Open source →
    Release notes
    • Added MathComparison.evaluate() - by jersonal-com
    Open source →
  2. 1.5.1 13 May 2023
    Release notes
    • Increased upper SDK constraint to declare support for Dart 3
    • Documentation fixes
    Open source →
    Release notes
    • Increased upper SDK constraint to declare support for Dart 3
    • Documentation fixes
    Open source →
  3. 1.5.0 20 Mar 2022
    Release notes

    Breaking changes

    • Now the ' symbol is allowed for variable and function names so you can have variables like y'.

    Equations

    • Implemented >= and <=.
    Open source →
    Release notes

    Breaking changes

    • Now the ' symbol is allowed for variable and function names so you can have variables like y'.

    Equations

    • Implemented >= and <=.
    Open source →
  4. 1.4.0 15 Dec 2021
    Release notes

    Custom Functions

    • Define custom functions and redefine built-in functions when parsing
      an expression. See docs and example.
    • Use MathNodeExpression.getPotentialFunctionNames() to detect potentially
      used functions in a string.
    • Use period in the middle of custom variable and function names.
    • Under-hood, functions now support multiple comma separated arguments, so
      you can supply multiple arguments to your custom function.
    • Detect custom functions im math tree using
      MathExpression.getUsedFreeformFunctions().

    Breaking changes

    • MissingFunctionArgumentListException renamed to
      OutOfRangeFunctionArgumentListException
    • MathNodeExpression.fromString() may throw other errors besides
      MathException
    • MathNodeExpression.getPotentialVariableNames() is replaced by
      MathNodeExpression.getPotentialDefinable()
    • Instead of log[base](arg), you should pass log(base, arg) syntax now
    • Period is an allowed character in the middle of a variable name now

    Misc.

    • UnexpectedClosingBracketException and BracketsNotClosedException can
      now tell where the problem probably happened.
    • New MathParseException's InvalidFunctionNameException,
      DuplicateDeclarationException, InvalidFunctionArgumentsDeclaration.
    Open source →
    Release notes

    Custom Functions

    • Define custom functions and redefine built-in functions when parsing an expression. See docs and example.
    • Use MathNodeExpression.getPotentialFunctionNames() to detect potentially used functions in a string.
    • Use period in the middle of custom variable and function names.
    • Under-hood, functions now support multiple comma separated arguments, so you can supply multiple arguments to your custom function.
    • Detect custom functions im math tree using MathExpression.getUsedFreeformFunctions().

    Breaking Changes

    • MissingFunctionArgumentListException renamed to OutOfRangeFunctionArgumentListException
    • MathNodeExpression.fromString() may throw other errors besides MathException
    • MathNodeExpression.getPotentialVariableNames() is replaced by MathNodeExpression.getPotentialDefinable()
    • Instead of log[base](arg), you should pass log(base, arg) syntax now
    • Period is an allowed character in the middle of a variable name now

    Misc.

    • UnexpectedClosingBracketException and BracketsNotClosedException can now tell where the problem probably happened.
    • New MathParseException's InvalidFunctionNameException, DuplicateDeclarationException, InvalidFunctionArgumentsDeclaration.
    Open source →
  5. 1.3.1 07 Dec 2021
    Release notes

    1.3.1

    • Variable validation fix
    Open source →
    Release notes
    • Variable validation fix
    Open source →
  6. 1.3.0 06 Dec 2021 withdrawn
    Release notes

    1.3.0

    Math Tree

    • Important change: MathNode is now a class of MathExpression interface.
      Compared to MathNode, MathExpression may return null in calc() method.
    • New: getUsedVariables() method for MathExpression and MathNode.
      This method goes down the math tree to find any uses of MathVariable
      and returns names of all variables.
    • New: MathExpression object family - MathComparison:
      • MathComparisonEquation (=)
      • MathComparisonGreater (>)
      • MathComparisonLess (<)

    Parsing

    • New: MathNodeExpression.fromStringExtended() method allows you to
      interpret equations and comparisons. Compared to fromString,
      it returns MathExpression instead of MathNode, since comparisons
      can't guarantee result.
    • New: MathNodeExpression.getPotentialVariableNames() analyzes given
      math expression string for possible use of variables. Refer to
      documentation for rough edges before using it.
    • New: MathNodeExpression.builtInVariables gives a list of built-in
      predefined variable names.
    • New: MathNodeExpression.isVariableNameValid() lets you check if
      the parser can work with a given name.

    Misc.

    • Changed input parameters type for CantProcessExpressionException.
    • Small documentation fixes.
    Open source →
    Release notes

    Math Tree

    • Important change: MathNode is now a class of MathExpression interface. Compared to MathNode, MathExpression may return null in calc() method.
    • New: getUsedVariables() method for MathExpression and MathNode. This method goes down the math tree to find any uses of MathVariable and returns names of all variables.
    • New: MathExpression object family - MathComparison:
      • MathComparisonEquation (=)
      • MathComparisonGreater (>)
      • MathComparisonLess (<)

    Parsing

    • New: MathNodeExpression.fromStringExtended() method allows you to interpret equations and comparisons. Compared to fromString, it returns MathExpression instead of MathNode, since comparisons can't guarantee result.
    • New: MathNodeExpression.getPotentialVariableNames() analyzes given math expression string for possible use of variables. Refer to documentation for rough edges before using it.
    • New: MathNodeExpression.builtInVariables gives a list of built-in predefined variable names.
    • New: MathNodeExpression.isVariableNameValid() lets you check if the parser can work with a given name.

    Misc.

    • Changed input parameters type for CantProcessExpressionException.
    • Small documentation fixes.
    Open source →
  7. 1.2.0 25 Nov 2021
    Release notes
    • Custom variables support.
    • MathFunctionXdeprecated.
    • MathVariable introduced.
    • You need to pass an instance of MathVariableValues instead of a num to the calc() function now
    • Fix README
    • Moved integrating features to a separate package library math_parser_integrate
    Open source →
    Release notes
    • Fix README.
    • Moved integrating features to a separate package library math_parser_integrate.
    Open source →
  8. 1.1.0 25 Nov 2021
    Release notes
    • Custom variables support.
    • MathFunctionXdeprecated.
    • MathVariable introduced.
    • You need to pass an instance of MathVariableValues instead of a num to the calc() function now.
    Open source →
  9. 1.0.0 18 Nov 2021
    Release notes
    • Initial release.
    Open source →
    Release notes
    • Initial version.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive