Beispiel #1
0
 public static object Sqrt(object x)
 {
     if (ObjectValue.IsAnyDouble(x))
     {
         return(DoubleMath.Sqrt(DoubleValue.ToDouble(x)));
     }
     return(null);
 }
Beispiel #2
0
 public static object Power(object x, object y)
 {
     if (ObjectValue.IsAnyDouble(x, y))
     {
         return(DoubleMath.Power(DoubleValue.ToDouble(x), DoubleValue.ToDouble(y)));
     }
     return(null);
 }
Beispiel #3
0
 public static object Square(object x)
 {
     if (ObjectValue.IsAnyDouble(x))
     {
         return(DoubleMath.Square(DoubleValue.ToDouble(x)));
     }
     if (ObjectValue.IsAnyDecimal(x))
     {
         return(DecimalValue.Square(DecimalValue.ToDecimal(x)));
     }
     return(null);
 }
Beispiel #4
0
 public static object Reciprocal(object x)
 {
     if (ObjectValue.IsAnyDouble(x))
     {
         return(DoubleMath.Reciprocal(DoubleValue.ToDouble(x)));
     }
     if (ObjectValue.IsAnyDecimal(x))
     {
         return(DecimalValue.Reciprocal(DecimalValue.ToDecimal(x)));
     }
     return(null);
 }
Beispiel #5
0
 public static object Divide(object x, object y)
 {
     if (ObjectValue.IsAnyDouble(x, y))
     {
         return(DoubleMath.Divide(DoubleValue.ToDouble(x), DoubleValue.ToDouble(y)));
     }
     if (ObjectValue.IsAnyDecimal(x, y))
     {
         return(DecimalValue.Divide(DecimalValue.ToDecimal(x), DecimalValue.ToDecimal(y)));
     }
     return(null);
 }
Beispiel #6
0
 public static object Multiply(object x, object y)
 {
     if (ObjectValue.IsBool(x, y))
     {
         return(BooleanValue.Multiply((bool)x, (bool)y));
     }
     if (ObjectValue.IsAnyDouble(x, y))
     {
         return(DoubleMath.Multiply(DoubleValue.ToDouble(x), DoubleValue.ToDouble(y)));
     }
     if (ObjectValue.IsAnyDecimal(x, y))
     {
         return(DecimalValue.Multiply(DecimalValue.ToDecimal(x), DecimalValue.ToDecimal(y)));
     }
     return(null);
 }
Beispiel #7
0
 public static object Subtract(object x, object y)
 {
     if (ObjectValue.IsDateTime(x, y))
     {
         return(DateTimeMath.Subtract((DateTime)x, (DateTime)y));
     }
     if (ObjectValue.IsAnyDouble(x, y))
     {
         return(DoubleMath.Subtract(DoubleValue.ToDouble(x), DoubleValue.ToDouble(y)));
     }
     if (ObjectValue.IsAnyDecimal(x, y))
     {
         return(DecimalValue.Subtract(DecimalValue.ToDecimal(x), DecimalValue.ToDecimal(y)));
     }
     return(null);
 }
Beispiel #8
0
 public static bool IsEqual(object x, object y)
 {
     if (ObjectValue.IsDateTime(x, y))
     {
         return(DateTimeMath.IsEqual((DateTime)x, (DateTime)y));
     }
     if (ObjectValue.IsFloat(x, y))
     {
         return(FloatValue.IsAlmost((float)x, (float)y));
     }
     if (ObjectValue.IsDouble(x, y))
     {
         return(DoubleMath.IsAlmost((double)x, (double)y));
     }
     if (ObjectValue.IsDecimal(x, y))
     {
         return(DecimalValue.IsEqual((decimal)x, (decimal)y));
     }
     return(x.Equals(y));
 }
Beispiel #9
0
 public static object Add(object x, object y)
 {
     if (ObjectValue.IsBool(x, y))
     {
         return(BooleanValue.Add((bool)x, (bool)y));
     }
     if (ObjectValue.IsString(x, y))
     {
         return(StringValue.Add((string)x, (string)y));
     }
     if (ObjectValue.IsDateTime(x, y))
     {
         return(DateTimeMath.Add((DateTime)x, (DateTime)y));
     }
     if (ObjectValue.IsAnyDouble(x, y))
     {
         return(DoubleMath.Add(DoubleValue.ToDouble(x), DoubleValue.ToDouble(y)));
     }
     if (ObjectValue.IsAnyDecimal(x, y))
     {
         return(DecimalValue.Add(DecimalValue.ToDecimal(x), DecimalValue.ToDecimal(y)));
     }
     return(null);
 }