Exemplo n.º 1
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);
 }
Exemplo n.º 2
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);
 }
Exemplo n.º 3
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);
 }
Exemplo n.º 4
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);
 }
Exemplo n.º 5
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);
 }
Exemplo n.º 6
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));
 }
Exemplo n.º 7
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);
 }