Leibniz is a pure erlang/elixir math expression parser and evaluator.
defp deps() do
[{:leibniz, "~> 1.0.0"}]
end
Leibniz provides two core functionalities, evaluating valid math expressions and evaluating valid math expression in a given context.
Evaluating simple math expressions
Leibniz.eval("1 + 1")
{:ok, 2}
Evaluating math expressions in a given context
Leibniz.eval("10 * foo", foo: 10)
{:ok, 100}
Leibniz.eval("1 * baz")
{:error, "value expected for the following dependencies: baz"}
- Improve errors
- Provide a
parse/1
function - Provide a
depencies/1
function - Add trigonometric and other math functions
MIT