Math Eval is Yet Another Math Evaluator.
for using eval is necessary to create an Evaluator with
e := meval.New().
An evaluator contains the variables and the functions
e.SetVar("x", 42).
For evaluating expressions use the Eval method
e.Eval("x+2").
eval comes with some builtins functions, others may be added in future:
Ln, Log10, Log2, Sin, Cos, Tan, Sqrt.
e.Eval("ln(2)")
eval comes with some predefine math constants, others may be added in future:
Pi, E.
e.Eval("pi")
Meval is currently built around a modified copy the Golang parser, this was chosen for the semplicity of implementing, in future a custom one could be used. The source code of the parser can be found in the internal subdirctory.