public override int GetHashCode() { var hashCode = -783812246; hashCode = hashCode * -1521134295 + base.GetHashCode(); hashCode = hashCode * -1521134295 + Value.GetHashCode(); return(hashCode); }
public void TestEquality() { BigDecimal a = new BigDecimal(14121976); BigDecimal b = new BigDecimal(141219760000, 4); Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); Assert.AreEqual(a, b); a = new BigDecimal(14121976, 4); b = new BigDecimal(1412.1976m); Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); Assert.AreEqual(a, b); a = new BigDecimal(-14121976, 4); b = new BigDecimal(-1412.1976m); Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); Assert.AreEqual(a, b); }
public static int Hash(BigDecimal/*!*/ self) { return self.GetHashCode(); }
public override int GetHashCode() { return(_value.GetHashCode()); }
public static int Hash(BigDecimal /*!*/ self) { return(self.GetHashCode()); }
/// <summary> /// Returns a hashcode. /// </summary> /// <returns>An integer value representing the hashcode.</returns> public override int GetHashCode() { // ReSharper disable once NonReadonlyMemberInGetHashCode return(Backing.GetHashCode()); }
public override int GetHashCode() { return(innerValue.GetHashCode() ^ State.GetHashCode()); }
public override int GetHashCode() { return(Val.GetHashCode()); }
public override int GetHashCode() { return(bigDecimal.GetHashCode() ^ numberState.GetHashCode()); }
public void TestGetHashCode() { // anything that is equal must have the same hashCode BigDecimal hash = BigDecimal.Parse("1.00"); BigDecimal hash2 = new BigDecimal(1.00D); Assert.IsTrue(hash.GetHashCode() != hash2.GetHashCode() && !hash.Equals(hash2), "the hashCode of 1.00 and 1.00D is equal"); hash2 = BigDecimal.Parse("1.0"); Assert.IsTrue(hash.GetHashCode() != hash2.GetHashCode() && !hash.Equals(hash2), "the hashCode of 1.0 and 1.00 is equal"); BigInteger val = BigInteger.Parse("100"); hash2 = new BigDecimal(val, 2); Assert.IsTrue(hash.GetHashCode() == hash2.GetHashCode() && hash.Equals(hash2), "hashCode of 1.00 and 1.00(bigInteger) is not equal"); hash = new BigDecimal(value, 2); hash2 = BigDecimal.Parse("-1233456.0000"); Assert.IsTrue(hash.GetHashCode() != hash2.GetHashCode() && !hash.Equals(hash2), "hashCode of 123459.08 and -1233456.0000 is not equal"); hash2 = new BigDecimal(value.Negate(), 2); Assert.IsTrue(hash.GetHashCode() != hash2.GetHashCode() && !hash.Equals(hash2), "hashCode of 123459.08 and -123459.08 is not equal"); }