public int CompareTo(BNumber other) { if (other == null) { return(1); } return(fValue.CompareTo(other.fValue)); }
public void Test_BNumber_class() { BNumber bnumber = new BNumber(12345); Assert.IsNotNull(bnumber); Assert.AreEqual(12345, bnumber.Value); Assert.AreEqual("i12345e", bnumber.EncodeAsString()); Assert.IsTrue(bnumber.Equals((BNumber)12345)); Assert.AreEqual(0, bnumber.CompareTo(12345)); int intVal = 123; bnumber = intVal; Assert.AreEqual(123, bnumber.Value); bnumber = 321; intVal = bnumber; Assert.AreEqual(321, intVal); long longVal = 456; bnumber = longVal; Assert.AreEqual(456, bnumber.Value); bnumber = 654; longVal = bnumber; Assert.AreEqual(654, longVal); bool boolVal = true; bnumber = boolVal; Assert.AreEqual(1, bnumber.Value); bnumber = 0; boolVal = bnumber; Assert.AreEqual(false, boolVal); }
/// <summary> /// Adds a number (integer or long) to the list. /// </summary> /// <param name="value"></param> public void Add(BNumber value) { Add((IBObject)value); }