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); }
public static double Log10(FunctionToken func, Evaluator evaluator) { var args = func.Arguments; var num = args[0].Evaluate(evaluator); return Math.Log10(num); }
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)); }
public static double GradToRad(FunctionToken func, Evaluator evaluator) { var args = func.Arguments; var num = args[0].Evaluate(evaluator); return num.ToRadians(Mode.Grad); }
public static double Min(FunctionToken func, Evaluator evaluator) { var args = func.Arguments; return args.Select(ar => ar.Evaluate(evaluator)).Min(); }