Пример #1
0
        public static object Add(object x, object y)
        {
            if (AreTypes.Bool(x, y))
            {
                return(((bool)x).Add((bool)y));
            }
            if (AreTypes.String(x, y))
            {
                return(Strings.Add((string)x, (string)y));
            }
            if (AreTypes.DateTime(x, y))
            {
                return(((DateTime)x).AddSafe((DateTime)y));
            }
            if (AreTypes.AnyDecimal(x, y))
            {
                return(Converting.ToDecimal(x).Add(Converting.ToDecimal(y)));
            }
            if (AreTypes.AnyDouble(x, y))
            {
                return(Doubles.ToDouble(x).Add(Doubles.ToDouble(y)));
            }

            return(null);
        }
Пример #2
0
        public static object IsGreater(object x, object y)
        {
            if (AreTypes.Bool(x, y))
            {
                return(((bool)x).IsGreater((bool)y));
            }
            if (AreTypes.String(x, y))
            {
                return(((string)x).IsGreater((string)y));
            }
            if (AreTypes.DateTime(x, y))
            {
                return(((DateTime)x).IsGreater((DateTime)y));
            }
            if (AreTypes.AnyDecimal(x, y))
            {
                return(Converting.ToDecimal(x).IsGreater(Converting.ToDecimal(y)));
            }
            if (AreTypes.AnyDouble(x, y))
            {
                return(Doubles.ToDouble(x).IsGreater(Doubles.ToDouble(y)));
            }

            return(null);
        }
Пример #3
0
        public static object Inverse(object x)
        {
            if (AreTypes.AnyDecimal(x))
            {
                return(Converting.ToDecimal(x).Inverse());
            }
            if (AreTypes.AnyDouble(x))
            {
                return(Doubles.ToDouble(x).Inverse());
            }

            return(null);
        }
Пример #4
0
        public static object Divide(object x, object y)
        {
            if (AreTypes.AnyDecimal(x, y))
            {
                return(Converting.ToDecimal(x).Divide(Converting.ToDecimal(y)));
            }
            if (AreTypes.AnyDouble(x, y))
            {
                return(Doubles.ToDouble(x).Divide(Doubles.ToDouble(y)));
            }

            return(null);
        }
Пример #5
0
        public static object Multiply(object x, object y)
        {
            if (AreTypes.Bool(x, y))
            {
                return(((bool)x).Multiply((bool)y));
            }
            if (AreTypes.AnyDecimal(x, y))
            {
                return(Converting.ToDecimal(x).Multiply(Converting.ToDecimal(y)));
            }
            if (AreTypes.AnyDouble(x, y))
            {
                return(Doubles.ToDouble(x).Multiply(Doubles.ToDouble(y)));
            }

            return(null);
        }
Пример #6
0
        public static object Subtract(object x, object y)
        {
            if (AreTypes.DateTime(x, y))
            {
                return(((DateTime)x).SubtractSafe((DateTime)y));
            }
            if (AreTypes.AnyDecimal(x, y))
            {
                return(Converting.ToDecimal(x).Subtract(Converting.ToDecimal(y)));
            }
            if (AreTypes.AnyDouble(x, y))
            {
                return(Doubles.ToDouble(x).Subtract(Doubles.ToDouble(y)));
            }

            return(null);
        }