Crate calc[−][src]
Calculator library for evaluating freehand mathematical expressions.
The general workflow goes like this:
-
Create a
Context
: a reusable type which contains expression history.This type is parametrized by the numeric type which all calculations will use.
-
Parse an
ast::Expr
withast::parser::ExprParser
. -
Evaluate that expression with
Context::evaluate
.
You can freely modify the parsed expression; the types in ast
are all public.
To enable calculation based on your custom numeric type, just impl types::Calcable
for your type.
Modules
ast | |
types |
Structs
Context | Calculation context. |
Enums
Error |