Ejemplo n.º 1
0
 public virtual Net.Vpc.Upa.Impl.Util.XNumber Add(Net.Vpc.Upa.Impl.Util.XNumber other) {
     System.Type c = BestFit(type, other.type);
     if (c == typeof(byte?)) {
         return new Net.Vpc.Upa.Impl.Util.XNumber(ByteValue() + other.ByteValue());
     } else if (c == typeof(short?)) {
         return new Net.Vpc.Upa.Impl.Util.XNumber(ShortValue() + other.ShortValue());
     } else if (c == typeof(int?)) {
         return new Net.Vpc.Upa.Impl.Util.XNumber(IntValue() + other.IntValue());
     } else if (c == typeof(float?)) {
         return new Net.Vpc.Upa.Impl.Util.XNumber(FloatValue() + other.FloatValue());
     } else if (c == typeof(double?)) {
         return new Net.Vpc.Upa.Impl.Util.XNumber(DoubleValue() + other.DoubleValue());
     } else if (c == typeof(System.Numerics.BigInteger?)) {
         return new Net.Vpc.Upa.Impl.Util.XNumber(((BigIntegerValue())+(other.BigIntegerValue())));
     } else if (c == typeof(System.Decimal?)) {
         return new Net.Vpc.Upa.Impl.Util.XNumber(((BigDecimalValue())+(other.BigDecimalValue())));
     }
     throw new System.ArgumentException ("Invalid");
 }
Ejemplo n.º 2
0
 public virtual int CompareTo(Net.Vpc.Upa.Impl.Util.XNumber other) {
     System.Type c = BestFit(type, other.type);
     if (c == typeof(byte?)) {
         return ByteValue().CompareTo(other.ByteValue());
     } else if (c == typeof(short?)) {
         return ShortValue().CompareTo(other.ShortValue());
     } else if (c == typeof(int?)) {
         return IntValue().CompareTo(other.IntValue());
     } else if (c == typeof(float?)) {
         return FloatValue().CompareTo(other.FloatValue());
     } else if (c == typeof(double?)) {
         return DoubleValue().CompareTo(other.DoubleValue());
     } else if (c == typeof(System.Numerics.BigInteger?)) {
         return (BigIntegerValue().Value.CompareTo(other.BigIntegerValue()));
     } else if (c == typeof(System.Decimal?)) {
         return (BigDecimalValue().Value.CompareTo(other.BigDecimalValue()));
     }
     throw new System.ArgumentException ("Invalid");
 }