示例#1
0
 public static double Log(FunctionToken func, Evaluator evaluator)
 {
     var args = func.Arguments;
     var a = args[0].Evaluate(evaluator);
     if (args.Length == 1)
         return Math.Log(a);
     var @base = args[1].Evaluate(evaluator);
     return Math.Log(a, @base);
 }
示例#2
0
 public static double Log10(FunctionToken func, Evaluator evaluator)
 {
     var args = func.Arguments;
     var num = args[0].Evaluate(evaluator);
     return Math.Log10(num);
 }
示例#3
0
 public static double Cos(FunctionToken func, Evaluator evaluator)
 {
     var args = func.Arguments;
     var num = args[0].Evaluate(evaluator);
     return Math.Cos(num.ToRadians(evaluator.Settings.Mode));
 }
示例#4
0
 public static double GradToRad(FunctionToken func, Evaluator evaluator)
 {
     var args = func.Arguments;
     var num = args[0].Evaluate(evaluator);
     return num.ToRadians(Mode.Grad);
 }
示例#5
0
 public static double Min(FunctionToken func, Evaluator evaluator)
 {
     var args = func.Arguments;
     return args.Select(ar => ar.Evaluate(evaluator)).Min();
 }