예제 #1
0
        public object Execute(IArgument[] arguments, Engine context)
        {
            if (arguments.Length == 0)
            {
                throw new ArgumentCountException("Power takes at least one argument");
            }

            if (arguments.Length == 1)
            {
                return(Math.Exp(arguments[0].ToDouble(context)));
            }
            else
            {
                var pair = Base.Get(arguments, context);
                return(Math.Pow(pair.Item1, pair.Item2));
            }
        }
예제 #2
0
 public object Execute(IArgument[] arguments, Engine context)
 {
     if (arguments.Length == 1)
     {
         tolerance = arguments[0].ToDouble(context);
         return(null);
     }
     else
     {
         var tup = Base.Get(arguments, context, false);
         if (arguments.Length > 2)
         {
             return(Math.Abs(tup.Item1 - tup.Item2) > arguments[2].ToDouble(context));
         }
         else
         {
             return(Math.Abs(tup.Item1 - tup.Item2) > tolerance);
         }
     }
 }
예제 #3
0
        public object Execute(IArgument[] arguments, Engine context)
        {
            var tup = Base.Get(arguments, context);

            return(tup.Item1 >= tup.Item2);
        }