Ejemplo n.º 1
0
 public static object Box(SqlSingle a)
 {
     if (a.IsNull)
         return null;
     else
         return a.Value;
 }
 static SqlSingle()
 {
     Null     = new SqlSingle(true);
     Zero     = new SqlSingle(0f);
     MinValue = new SqlSingle(float.MinValue);
     MaxValue = new SqlSingle(float.MaxValue);
 }
Ejemplo n.º 3
0
                public void Properties()
                {
                        SqlSingle Test = new SqlSingle (5443e12f);
                        SqlSingle Test1 = new SqlSingle (1);

                        Assert ("#C01", SqlSingle.Null.IsNull);
                        AssertEquals ("#C02", 5443e12f, Test.Value);
                        AssertEquals ("#C03", (float)1, Test1.Value);
                }
Ejemplo n.º 4
0
        public void Properties()
        {
            SqlSingle Test = new SqlSingle(5443e12f);
            SqlSingle Test1 = new SqlSingle(1);

            Assert.True(SqlSingle.Null.IsNull);
            Assert.Equal(5443e12f, Test.Value);
            Assert.Equal(1, Test1.Value);
        }
Ejemplo n.º 5
0
                public void Properties()
                {
                        SqlSingle Test = new SqlSingle (5443e12f);
                        SqlSingle Test1 = new SqlSingle (1);

                        Assert.IsTrue (SqlSingle.Null.IsNull, "#C01");
                        Assert.AreEqual (5443e12f, Test.Value, "#C02");
                        Assert.AreEqual ((float)1, Test1.Value, "#C03");
                }
Ejemplo n.º 6
0
        // IComparable
        // Compares this object to another object, returning an integer that
        // indicates the relationship.
        // Returns a value less than zero if this < object, zero if this = object,
        // or a value greater than zero if this > object.
        // null is considered to be less than any instance.
        // If object is not of same type, this method throws an ArgumentException.
        public int CompareTo(object value)
        {
            if (value is SqlSingle)
            {
                SqlSingle i = (SqlSingle)value;

                return CompareTo(i);
            }
            throw ADP.WrongType(value.GetType(), typeof(SqlSingle));
        }
        public int CompareTo(object value)
        {
            if (!(value is SqlSingle))
            {
                throw ADP.WrongType(value.GetType(), typeof(SqlSingle));
            }
            SqlSingle num = (SqlSingle)value;

            return(this.CompareTo(num));
        }
Ejemplo n.º 8
0
 // Builtin functions
 internal static SqlSingle    Abs(SqlSingle x)
 {
     if (x.IsNull || x.m_value >= 0)
     {
         return(x);
     }
     else
     {
         return(new SqlSingle(-x.m_value));
     }
 }
Ejemplo n.º 9
0
 private int CompareSqlSingle(SqlSingle value)
 {
     if (value.IsNull)
     {
         return(1);
     }
     else
     {
         return(this.value.CompareTo(value.Value));
     }
 }
Ejemplo n.º 10
0
                public void Create()
                {
                        SqlSingle Test= new SqlSingle ((float)34.87);
                        SqlSingle Test2 = 45.2f;
                        
                        AssertEquals ("#A01", 34.87f, Test.Value);
                        AssertEquals ("#A02", 45.2f, Test2.Value);

                        Test = new SqlSingle (-9000.6543);
                        AssertEquals ("#A03", -9000.6543f, Test.Value);
                }
Ejemplo n.º 11
0
                public void Create()
                {
                        SqlSingle Test= new SqlSingle ((float)34.87);
                        SqlSingle Test2 = 45.2f;
                        
                        Assert.AreEqual (34.87f, Test.Value, "#A01");
                        Assert.AreEqual (45.2f, Test2.Value, "#A02");

                        Test = new SqlSingle (-9000.6543);
                        Assert.AreEqual (-9000.6543f, Test.Value, "#A03");
                }
Ejemplo n.º 12
0
        public int CompareTo(SqlSingle value)
        {
            // If both Null, consider them equal.
            // Otherwise, Null is less than anything.
            if (IsNull)
                return value.IsNull ? 0 : -1;
            else if (value.IsNull)
                return 1;

            if (this < value) return -1;
            if (this > value) return 1;
            return 0;
        }
Ejemplo n.º 13
0
        /**
         * Performs a logical comparison on two instances of SqlSingle to determine if they are equal.
         * @param x A SqlSingle instance.
         * @param y A SqlSingle instance.
         * @return true if the two values are equal, otherwise false.
         * If one of the parameters is null or null value return SqlBoolean.Null.
         */
        public static SqlBoolean Equals(SqlSingle x, SqlSingle y)
        {
            if (x.IsNull || y.IsNull)
            {
                return(SqlBoolean.Null);
            }

            if (x.Equals(y))
            {
                return(SqlBoolean.True);
            }

            return(SqlBoolean.False);
        }
Ejemplo n.º 14
0
        /**
         * Compares two instances of SqlSingle to determine if the first is less than or equal to the second.
         * @param x A SqlSingle instance
         * @param y A SqlSingle instance
         * @return A SqlBoolean that is True if the first instance is less than or equal to the second instance, otherwise False.
         * If either instance of SqlSingle is null, the Value of the SqlBoolean will be Null.
         */
        public static SqlBoolean LessThanOrEqual(SqlSingle x, SqlSingle y)
        {
            if (x.IsNull || y.IsNull)
            {
                return(SqlBoolean.Null);
            }

            if (x._value <= y._value)
            {
                return(SqlBoolean.True);
            }

            return(SqlBoolean.False);
        }
Ejemplo n.º 15
0
        /**
         * Compares two instances of SqlSingle to determine if the first is greater than the second.
         * @param x A SqlSingle instance
         * @param y A SqlSingle instance
         * @return A SqlBoolean that is True if the first instance is greater than the second instance, otherwise False.
         * If either instance of SqlSingle is null, the Value of the SqlBoolean will be Null.
         */
        public static SqlBoolean GreaterThan(SqlSingle x, SqlSingle y)
        {
            if (x.IsNull || y.IsNull)
            {
                return(SqlBoolean.Null);
            }

            if (x._value > y._value)
            {
                return(SqlBoolean.True);
            }

            return(SqlBoolean.False);
        }
Ejemplo n.º 16
0
        // Compares this instance with a specified object
        public override bool Equals(object value)
        {
            if (!(value is SqlSingle))
            {
                return false;
            }

            SqlSingle i = (SqlSingle)value;

            if (i.IsNull || IsNull)
                return (i.IsNull && IsNull);
            else
                return (this == i).Value;
        }
Ejemplo n.º 17
0
        /**
         * Compares two instances of SqlSingle to determine if they are equal.
         * @param x A SqlSingle instance
         * @param y A SqlSingle instance
         * @return A SqlBoolean that is True if the two instances are not equal or False if the two instances are equal.
         * If either instance of SqlSingle is null, the Value of the SqlBoolean will be Null.
         */
        public static SqlBoolean NotEquals(SqlSingle x, SqlSingle y)
        {
            SqlBoolean res = Equals(x, y);

            if (res.IsNull)
            {
                return(res);
            }
            if (res.IsFalse)
            {
                return(SqlBoolean.True);
            }

            return(SqlBoolean.False);
        }
        public override bool Equals(object value)
        {
            if (!(value is SqlSingle))
            {
                return(false);
            }
            SqlSingle num = (SqlSingle)value;

            if (num.IsNull || this.IsNull)
            {
                return(num.IsNull && this.IsNull);
            }
            SqlBoolean flag = this == num;

            return(flag.Value);
        }
Ejemplo n.º 19
0
        public static SqlByte op_Explicit(SqlSingle x)
        {
            if (x.IsNull)
            {
                return(SqlByte.Null);
            }

            float val = x.Value;

            if (val < 0 || val > 255)
            {
                throw new OverflowException("Arithmetic Overflow.");
            }

            return(new SqlByte((byte)val));
        }
Ejemplo n.º 20
0
        // Compares this instance with a specified object
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public override bool Equals(Object value)
        {
            if (!(value is SqlSingle))
            {
                return(false);
            }

            SqlSingle i = (SqlSingle)value;

            if (i.IsNull || IsNull)
            {
                return(i.IsNull && IsNull);
            }
            else
            {
                return((this == i).Value);
            }
        }
Ejemplo n.º 21
0
        /**
         * The subtraction operator the second SqlSingle operand from the first.
         * @param x A SqlSingle instance
         * @param y A SqlSingle instance
         * @return The results of the subtraction operation.
         */
        public static SqlSingle Subtract(SqlSingle x, SqlSingle y)
        {
            if (x.IsNull || y.IsNull)
            {
                return(SqlSingle.Null);
            }

            float xVal = x._value;
            float yVal = y._value;

            if (xVal < 0 && yVal > 0 && (java.lang.Math.abs(_minVal - xVal) < yVal))
            {
                throw new System.OverflowException("Overflow - " + x + " - " + y + " < " + _minVal);
            }
            if (xVal > 0 && yVal < 0 && (_maxVal - xVal < java.lang.Math.abs(yVal)))
            {
                throw new System.OverflowException("Overflow - " + x + " - " + y + " > " + _maxVal);
            }


            return(new SqlSingle(x._value - y._value));
        }
Ejemplo n.º 22
0
        /**
         * The addition operator computes the sum of the two SqlSingle operands.
         * @param x A SqlSingle structure.
         * @param y A SqlSingle structure.
         * @return The sum of the two SqlSingle operands.
         * If one of the parameters is null or null value - return SqlSingle.Null.
         */
        public static SqlSingle Add(SqlSingle x, SqlSingle y)
        {
            if (x.IsNull || y.IsNull)
            {
                return(SqlSingle.Null);
            }

            float xVal = x._value;
            float yVal = y._value;

            if (xVal < 0 && yVal < 0 && (_minVal - xVal > yVal))
            {
                throw new System.OverflowException("Overflow - " + x + " + " + y + " < " + _minVal);
            }
            if (xVal > 0 && yVal > 0 && (_maxVal - xVal < yVal))
            {
                throw new System.OverflowException("Overflow - " + x + " + " + y + " > " + _maxVal);
            }


            return(new SqlSingle(xVal + yVal));
        }
Ejemplo n.º 23
0
        public int CompareTo(SqlSingle value)
        {
            // If both Null, consider them equal.
            // Otherwise, Null is less than anything.
            if (IsNull)
            {
                return(value.IsNull ? 0  : -1);
            }
            else if (value.IsNull)
            {
                return(1);
            }

            if (this < value)
            {
                return(-1);
            }
            if (this > value)
            {
                return(1);
            }
            return(0);
        }
 public int CompareTo(SqlSingle value)
 {
     if (this.IsNull)
     {
         if (!value.IsNull)
         {
             return(-1);
         }
         return(0);
     }
     if (value.IsNull)
     {
         return(1);
     }
     if (SqlBoolean.op_True(this < value))
     {
         return(-1);
     }
     if (SqlBoolean.op_True(this > value))
     {
         return(1);
     }
     return(0);
 }
Ejemplo n.º 25
0
        override public object ConvertXmlToObject(string s) {
            SqlSingle newValue = new SqlSingle();
            string tempStr =string.Concat("<col>", s, "</col>"); // this is done since you can give fragmet to reader, bug 98767
            StringReader strReader = new  StringReader(tempStr);

            IXmlSerializable tmp = newValue;
            
            using (XmlTextReader xmlTextReader = new XmlTextReader(strReader)) {
                tmp.ReadXml(xmlTextReader);
            }
            return ((SqlSingle)tmp);
        }
Ejemplo n.º 26
0
		public static SqlBoolean Equals (SqlSingle x, SqlSingle y)
		{
			return (x == y);
		}
Ejemplo n.º 27
0
 public int CompareTo(SqlSingle value)
 {
     return(CompareSqlSingle(value));
 }
Ejemplo n.º 28
0
		public void SqlSingleToSqlByte()
		{
			SqlSingle TestSingle64 = new SqlSingle(64);
			SqlSingle TestSingle900 = new SqlSingle(900);

			Assert.AreEqual((byte)64, ((SqlByte)TestSingle64).Value, "SqlSingleToByte" + Error);

			try {
				SqlByte test = (SqlByte)TestSingle900;
				Assert.Fail("SqlSingleToByte 2" + Error);
			} catch (Exception e) {

				Assert.AreEqual(typeof(OverflowException), e.GetType(), "OverflowException");
			}

		}
Ejemplo n.º 29
0
		private int CompareSqlSingle (SqlSingle value)
		{
			if (value.IsNull)
				return 1;
			else
				return this.value.CompareTo (value.Value);
		}
Ejemplo n.º 30
0
 private static void SetSqlSingle_Unchecked( SmiEventSink_Default sink, ITypedSettersV3 setters, int ordinal, SqlSingle value ) {
     if ( value.IsNull ) {
         setters.SetDBNull( sink, ordinal );
     }
     else {
         setters.SetSingle( sink, ordinal, value.Value ); 
     }
     sink.ProcessMessagesAndThrow();
 }
Ejemplo n.º 31
0
        //  implements SqlClient 1.1-compatible GetSqlValue() semantics for everything except output parameters
        internal static object GetSqlValue(
            SmiEventSink_Default    sink,
            ITypedGettersV3         getters,
            int                     ordinal,
            SmiMetaData             metaData,
            SmiContext              context
            ) {
            object result = null;
            if ( IsDBNull_Unchecked( sink, getters, ordinal ) ) {
                if (SqlDbType.Udt == metaData.SqlDbType) {
                    result = NullUdtInstance(metaData);
                }
                else {
                    result = __typeSpecificNullForSqlValue[(int)metaData.SqlDbType];
                }
            }
            else {
                switch( metaData.SqlDbType ) {
                    case SqlDbType.BigInt:
                        result = new SqlInt64( GetInt64_Unchecked( sink, getters, ordinal ) );
                        break;
                    case SqlDbType.Binary:
                        result = GetSqlBinary_Unchecked( sink, getters, ordinal );
                        break;
                    case SqlDbType.Bit:
                        result = new SqlBoolean( GetBoolean_Unchecked( sink, getters, ordinal ) );
                        break;
                    case SqlDbType.Char:
                        result = new SqlString( GetString_Unchecked( sink, getters, ordinal ) );
                        break;
                    case SqlDbType.DateTime:
                        result = new SqlDateTime( GetDateTime_Unchecked( sink, getters, ordinal ) );
                        break;
                    case SqlDbType.Decimal:
                        result = GetSqlDecimal_Unchecked( sink, getters, ordinal );
                        break;
                    case SqlDbType.Float:
                        result = new SqlDouble( GetDouble_Unchecked( sink, getters, ordinal ) );
                        break;
                    case SqlDbType.Image:
                        result = GetSqlBinary_Unchecked( sink, getters, ordinal );
                        break;
                    case SqlDbType.Int:
                        result = new SqlInt32( GetInt32_Unchecked( sink, getters, ordinal ) );
                        break;
                    case SqlDbType.Money:
                        result = GetSqlMoney_Unchecked( sink, getters, ordinal );
                        break;
                    case SqlDbType.NChar: 
                        result = new SqlString( GetString_Unchecked( sink, getters, ordinal ) );
                        break;
                    case SqlDbType.NText: 
                        result = new SqlString( GetString_Unchecked( sink, getters, ordinal ) );
                        break;
                    case SqlDbType.NVarChar: 
                        result = new SqlString( GetString_Unchecked( sink, getters, ordinal ) );
                        break;
                    case SqlDbType.Real:
                        result = new SqlSingle( GetSingle_Unchecked( sink, getters, ordinal ) );
                        break;
                    case SqlDbType.UniqueIdentifier:
                        result = new SqlGuid( GetGuid_Unchecked( sink, getters, ordinal ) );
                        break;
                    case SqlDbType.SmallDateTime:
                        result = new SqlDateTime( GetDateTime_Unchecked( sink, getters, ordinal ) );
                        break;
                    case SqlDbType.SmallInt:
                        result = new SqlInt16( GetInt16_Unchecked( sink, getters, ordinal ) );
                        break;
                    case SqlDbType.SmallMoney:
                        result = GetSqlMoney_Unchecked( sink, getters, ordinal );
                        break;
                    case SqlDbType.Text:
                        result = new SqlString( GetString_Unchecked( sink, getters, ordinal ) );
                        break;
                    case SqlDbType.Timestamp:
                        result = GetSqlBinary_Unchecked( sink, getters, ordinal );
                        break;
                    case SqlDbType.TinyInt:
                        result = new SqlByte( GetByte_Unchecked( sink, getters, ordinal ) );
                        break;
                    case SqlDbType.VarBinary:
                        result = GetSqlBinary_Unchecked( sink, getters, ordinal );
                        break;
                    case SqlDbType.VarChar:
                        result = new SqlString( GetString_Unchecked( sink, getters, ordinal ) );
                        break;
                    case SqlDbType.Variant:
                        metaData = getters.GetVariantType( sink, ordinal );
                        sink.ProcessMessagesAndThrow();
                        Debug.Assert( SqlDbType.Variant != metaData.SqlDbType, "Variant-within-variant causes endless recursion!" );
                        result = GetSqlValue( sink, getters, ordinal, metaData, context );
                        break;
                    case SqlDbType.Xml: 
                        result = GetSqlXml_Unchecked( sink, getters, ordinal, context );
                        break;
                    case SqlDbType.Udt:
                        result = GetUdt_LengthChecked( sink, getters, ordinal, metaData );
                        break;
                }
            }

            return result;
        }
Ejemplo n.º 32
0
 public static SqlBoolean LessThan(SqlSingle x, SqlSingle y)
 {
     return(x < y);
 }
Ejemplo n.º 33
0
 public static SqlBoolean LessThanOrEqual(SqlSingle x, SqlSingle y)
 {
     return(x <= y);
 }
Ejemplo n.º 34
0
		public static SqlSingle Add (SqlSingle x, SqlSingle y)
		{
			return (x + y);
		}
Ejemplo n.º 35
0
        //--------------------------------------------------
        // Alternative methods for overloaded operators
        //--------------------------------------------------

        // Alternative method for operator +
        public static SqlSingle Add(SqlSingle x, SqlSingle y)
        {
            return x + y;
        }
Ejemplo n.º 36
0
		public static SqlBoolean NotEquals (SqlSingle x, SqlSingle y)
		{
			return (x != y);
		}
Ejemplo n.º 37
0
		public static SqlBoolean LessThanOrEqual (SqlSingle x, SqlSingle y)
		{
			return (x <= y);
		}
Ejemplo n.º 38
0
		public static SqlBoolean GreaterThanOrEqual (SqlSingle x, SqlSingle y)
		{
			return (x >= y);
		}
Ejemplo n.º 39
0
        private Boolean ReadValues(System.IO.BinaryReader r)
        {
            Int32 count;
              if(r.BaseStream.Length == 0) return false;
              count = Sql.Read7BitEncodedInt(r);

              if (count == 0) return true;

              for (Int32 i = 0; i < count; i++)
              {
            String    name  = r.ReadString();
            SqlDbType LType = (SqlDbType)r.ReadUInt16();
            Object    value = null;
            Int32 len;
            //Int32 lcid;
            //SqlCompareOptions co;

            switch (LType)
            {
              case SqlDbType.Bit      : value = new SqlBoolean(r.ReadBoolean()); break;
              case SqlDbType.TinyInt  : value = new SqlByte(r.ReadByte()); break;
              case SqlDbType.SmallInt : value = new SqlInt16((Int16)r.ReadInt16()); break;
              case SqlDbType.Int      : value = new SqlInt32((Int32)r.ReadInt32()); break;
              case SqlDbType.BigInt   : value = new SqlInt64(r.ReadInt64()); break;

              case SqlDbType.Binary   :
              case SqlDbType.VarBinary: len = r.ReadUInt16(); value = new SqlBytes(r.ReadBytes(len)); break;

              case SqlDbType.Char     :
              case SqlDbType.VarChar  : //value = new Sql.SqlAnsiString(r); break;
              case SqlDbType.NChar:
              case SqlDbType.NVarChar:
            //co = (SqlCompareOptions)r.ReadUInt16();
            //lcid = r.ReadInt32();
            //value = new SqlString(r.ReadString(), lcid, co);
            value = new SqlString(r.ReadString());
            break;

              case SqlDbType.DateTime     : value = new SqlDateTime(DateTime.FromBinary(r.ReadInt64())); break;
              case SqlDbType.SmallDateTime:
              case SqlDbType.Date         :
              case SqlDbType.DateTime2    : value = DateTime.FromBinary(r.ReadInt64()); break;
              case SqlDbType.Time         : value = TimeSpan.FromTicks(r.ReadInt64()); break;
              case SqlDbType.DateTimeOffset:
            DateTime LDateTime = DateTime.FromBinary(r.ReadInt64());
            value = new DateTimeOffset(LDateTime, TimeSpan.FromTicks(r.ReadInt64()));
            break;

              case SqlDbType.Decimal: value = new SqlDecimal(r.ReadDecimal()); break;
              case SqlDbType.Float  : value = new SqlDouble(r.ReadDouble()); break;
              // Not support SqlDbType.Image
              case SqlDbType.Money  : value = new SqlMoney(r.ReadDecimal()); break;
              case SqlDbType.Real   : value = new SqlSingle(r.ReadDouble()); break;
              case SqlDbType.SmallMoney: value = new SqlMoney(r.ReadDecimal()); break;
              // Not support SqlDbType.Structured
              // Not support SqlDbType.Text
              // Not support SqlDbType.Timestamp
              case SqlDbType.UniqueIdentifier: value = new SqlGuid(r.ReadString()); break;
              // Not support SqlDbType.Variant
              case SqlDbType.Xml:
            XmlReader rXml = XmlReader.Create(new System.IO.StringReader(r.ReadString()));
            value = new SqlXml(rXml);
            break;

              case SqlDbType.Udt:
            // TODO: Пока поддержа только TParams
            //String LTypeName = r.ReadString();
            //value = CreateUdtObject(LTypeName);
            //if (value is IBinarySerialize)
            //  (value as IBinarySerialize).Read(r);
            //else
            //  throw new Exception(String.Format("Невозможно прочитать данные типа UDT '{0}' - не поддерживается IBinarySerialize", LTypeName));
            value = new SqlUdt(r);
            break;

              default:
            throw new Exception(String.Format("Невозможно прочитать данные, тип '{0}' не поддерживается текущей версией {1}", LType.ToString(), this.GetType().Name));
              // Not support SqlDbType.NText
            }
            if (value != null) FData.Add(name, value);
              }

              return true;
        }
Ejemplo n.º 40
0
 public static SqlSingle Multiply(SqlSingle x, SqlSingle y)
 {
     return(x * y);
 }
Ejemplo n.º 41
0
        internal static void SetSqlSingle( SmiEventSink_Default sink, ITypedSettersV3 setters, int ordinal, SmiMetaData metaData, SqlSingle value ) {
            ThrowIfInvalidSetterAccess( metaData, ExtendedClrTypeCode.SqlSingle );

            SetSqlSingle_Unchecked( sink, setters, ordinal, value ); 
        }
Ejemplo n.º 42
0
 public static SqlBoolean NotEquals(SqlSingle x, SqlSingle y)
 {
     return(x != y);
 }
Ejemplo n.º 43
0
        internal static SqlSingle GetSqlSingle( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal, SmiMetaData metaData ) {
            SqlSingle result;
            if ( CanAccessGetterDirectly( metaData, ExtendedClrTypeCode.SqlSingle ) ) {
                if ( IsDBNull_Unchecked( sink, getters, ordinal ) ) {
                    result = SqlSingle.Null;
                }
                else {
                    Single temp = GetSingle_Unchecked( sink, getters, ordinal );
                    result = new SqlSingle( temp );
                }
            }
            else {
                object obj = GetSqlValue( sink, getters, ordinal, metaData, null  );
                if (null == obj) {
                    throw ADP.InvalidCast();
                }
                result = (SqlSingle) obj;
            }

            return result;
        }
Ejemplo n.º 44
0
 public static SqlSingle Subtract(SqlSingle x, SqlSingle y)
 {
     return(x - y);
 }
Ejemplo n.º 45
0
		public void SqlSingleToSqlInt64 ()
		{
			SqlSingle TestSingle64 = new SqlSingle (64);
			Assert.AreEqual ((long) 64, ((SqlInt64) TestSingle64).Value, "#AE01");
		}
Ejemplo n.º 46
0
        /**
         * Compares two instances of SqlSingle to determine if they are equal.
         * @param x A SqlSingle instance
         * @param y A SqlSingle instance
         * @return A SqlBoolean that is True if the two instances are not equal or False if the two instances are equal.
         * If either instance of SqlSingle is null, the Value of the SqlBoolean will be Null.
         */
        public static SqlBoolean NotEquals(SqlSingle x, SqlSingle y)
        {
            SqlBoolean res = Equals(x, y);

            if (res.IsNull)
                return res;
            if (res.IsFalse)
                return SqlBoolean.True;

            return SqlBoolean.False;
        }
Ejemplo n.º 47
0
		public int CompareTo (SqlSingle value)
		{
			return CompareSqlSingle (value);
		}
Ejemplo n.º 48
0
        /**
         * The subtraction operator the second SqlSingle operand from the first.
         * @param x A SqlSingle instance
         * @param y A SqlSingle instance
         * @return The results of the subtraction operation.
         */
        public static SqlSingle Subtract(SqlSingle x, SqlSingle y)
        {
            if (x.IsNull || y.IsNull)
                return SqlSingle.Null;

            float xVal = x._value;
            float yVal = y._value;

            if (xVal < 0 && yVal > 0 && (java.lang.Math.abs(_minVal - xVal) < yVal))
                throw new System.OverflowException("Overflow - " + x + " - " + y + " < " + _minVal);
            if (xVal > 0 && yVal < 0 && (_maxVal - xVal < java.lang.Math.abs(yVal)))
                throw new System.OverflowException("Overflow - " + x + " - " + y + " > " + _maxVal);


            return new SqlSingle(x._value - y._value);

        }
Ejemplo n.º 49
0
		public static SqlSingle Divide (SqlSingle x, SqlSingle y)
		{
			return (x / y);
		}
Ejemplo n.º 50
0
 override public void SetCapacity(int capacity) {
     SqlSingle[] newValues = new SqlSingle[capacity];
     if (null != values) {
         Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
     }
     values = newValues;
 }
Ejemplo n.º 51
0
		public static SqlBoolean GreaterThan (SqlSingle x, SqlSingle y)
		{
			return (x > y);
		}
Ejemplo n.º 52
0
 public static SqlSingle Add(SqlSingle x, SqlSingle y)
 {
     return(x + y);
 }
Ejemplo n.º 53
0
		public static SqlBoolean LessThan (SqlSingle x, SqlSingle y)
		{
			return (x < y);
		}
Ejemplo n.º 54
0
 public static SqlSingle Divide(SqlSingle x, SqlSingle y)
 {
     return(x / y);
 }
Ejemplo n.º 55
0
		public static SqlSingle Multiply (SqlSingle x, SqlSingle y)
		{
			return (x * y);
		}
Ejemplo n.º 56
0
 public static SqlBoolean Equals(SqlSingle x, SqlSingle y)
 {
     return(x == y);
 }
Ejemplo n.º 57
0
		public static SqlSingle Subtract (SqlSingle x, SqlSingle y)
		{
			return (x - y);
		}
Ejemplo n.º 58
0
 public static SqlBoolean GreaterThan(SqlSingle x, SqlSingle y)
 {
     return(x > y);
 }
Ejemplo n.º 59
0
 public SqlSingle Adjust(SqlSingle value)
 {
     if (SqlDbType.Real != SqlDbType)
         ThrowInvalidType();
     return value;
 }
Ejemplo n.º 60
0
 public static SqlBoolean GreaterThanOrEqual(SqlSingle x, SqlSingle y)
 {
     return(x >= y);
 }