@Hemanth B , based on my research, it is hard to find a method to replace the Math.Pow function because there is no power operator in C#.
Currently, I only could use the following code to get the result for "4^6".
static async Task<double> EvaluateFormulaAsync(string formula)
{
return await CSharpScript.EvaluateAsync<double>(formula, ScriptOptions.Default.WithImports("System.Math"));
}
static void Main(string[] args)
{
var result = EvaluateFormulaAsync("System.Math.Pow(4, 6)").Result;
Console.WriteLine(result);
}
Result:
If the response is helpful, please click "Accept Answer" and upvote it.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.