Skip to content

gSpera/meval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Math Evaluator

GoDoc

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").

Functions

eval comes with some builtins functions, others may be added in future: Ln, Log10, Log2, Sin, Cos, Tan, Sqrt. e.Eval("ln(2)")

Math Constants

eval comes with some predefine math constants, others may be added in future: Pi, E. e.Eval("pi")

Parser

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.

About

Yet Another Math Evaluator in Go https://godoc.org/github.com/gSpera/meval

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages