本文整理汇总了C#中System.Data.SqlTypes.SqlSingle类的典型用法代码示例。如果您正苦于以下问题:C# SqlSingle类的具体用法?C# SqlSingle怎么用?C# SqlSingle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SqlSingle类属于System.Data.SqlTypes命名空间,在下文中一共展示了SqlSingle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Box
public static object Box(SqlSingle a)
{
if (a.IsNull)
return null;
else
return a.Value;
}
示例2: Properties
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);
}
示例3: Properties
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);
}
示例4: Properties
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");
}
示例5: Create
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);
}
示例6: Create
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");
}
示例7: Add
public static SqlSingle Add (SqlSingle x, SqlSingle y)
{
return (x + y);
}
示例8: NotEquals
public static SqlBoolean NotEquals (SqlSingle x, SqlSingle y)
{
return (x != y);
}
示例9: LessThanOrEqual
public static SqlBoolean LessThanOrEqual (SqlSingle x, SqlSingle y)
{
return (x <= y);
}
示例10: GreaterThanOrEqual
public static SqlBoolean GreaterThanOrEqual (SqlSingle x, SqlSingle y)
{
return (x >= y);
}
示例11: Equals
public static SqlBoolean Equals (SqlSingle x, SqlSingle y)
{
return (x == y);
}
示例12: CompareSqlSingle
private int CompareSqlSingle (SqlSingle value)
{
if (value.IsNull)
return 1;
else
return this.value.CompareTo (value.Value);
}
示例13: SetCapacity
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;
}
示例14: Subtract
/**
* 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);
}
示例15: NotEquals
/**
* 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;
}