|
@@ -15,4 +15,10 @@ func init() {
|
|
|
engine.RegFunction("ln", 1, func(expr ...engine.ExprAST) float64 {
|
|
|
return math.Log(engine.ExprASTResult(expr[0]))
|
|
|
})
|
|
|
+
|
|
|
+ engine.RegFunction("pow", 2, func(expr ...engine.ExprAST) float64 {
|
|
|
+ x := engine.ExprASTResult(expr[0])
|
|
|
+ y := engine.ExprASTResult(expr[1])
|
|
|
+ return math.Pow(x, y)
|
|
|
+ })
|
|
|
}
|