예제 #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();
 }