mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-18 20:04:28 +00:00
Fixed a rounding bug in the Matrix GetHashCode that would cause matrices that were deemed equal to not have the same hash code
This commit is contained in:
@ -121,6 +121,16 @@ namespace UnitTests.Numerics
|
||||
Assert.AreEqual(d, f);
|
||||
Assert.AreEqual(d.GetHashCode(), f.GetHashCode());
|
||||
|
||||
// Test rounding (thanks to nsp on GitHub for finding this case)
|
||||
var g = new SquareMatrix(1, 2.00000000000001,
|
||||
3, 4);
|
||||
|
||||
var h = new SquareMatrix(1, 2,
|
||||
3, 4);
|
||||
|
||||
Assert.IsTrue(g == h);
|
||||
Assert.AreEqual(g, h);
|
||||
Assert.AreEqual(g.GetHashCode(), h.GetHashCode());
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
Reference in New Issue
Block a user