nreco/lambdaparser

Math Operations like power (exponentiate) and to extract a root -possible?

tobiasdroessler opened this issue · 2 comments

Is it both possible and ready to use ?

Or is there a possibility to register external functions to extent feature set?

ref to dotnet math: (https://docs.microsoft.com/de-de/dotnet/api/system.math.pow?view=netcore-3.1)

You can easily register any API that you want to expose for expressions in this way:

class MathFunctions {
  public double Pow(double x, double y) => Math.Pow(x,y);
}

varContext["Math"] = new MathFunctions();
Console.WriteLine(lambdaParser.Eval("Math.Pow(2,2)", varContext));

ah, thank you .. now I get it !!

Thats nice.