math library

Mathematical expression parser, AST models, and evaluation engine.

For example:

final result = parser.parse('1 + 2 * 3');
final value = result.value.eval({});
print(value);  // 7.0

Classes

Application
A function or operator application expression.
Expression
An abstract mathematical expression that can be evaluated.
Value
A literal numeric value expression.
Variable
A named variable expression resolved from a variable map.

Constants

constants → const Map<String, double>
Mathematical constants mapped to their num values.

Properties

functions1 → Map<String, num Function(num x)>
Single-argument mathematical functions mapped to unary evaluation closures.
final
functions2 → Map<String, Function>
Two-argument mathematical functions mapped to binary evaluation closures.
final
parser → Parser<Expression>
A mathematical expression parser supporting arithmetic, functions, and variables.
final