Skip to content

Commit af009c5

Browse files
committed
Merge fix: Int2-3 Equality using MathF and tolerance (stride3d#2934)
commit 6a3aaa8 Author: Eideren <contact@eideren.com> Date: Thu Oct 16 10:15:46 2025 +0200 fix: Int2-3 Equality using MathF and tolerance (stride3d#2934)
1 parent ded1a96 commit af009c5

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

sources/core/Stride.Core.Mathematics/Int2.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,7 @@ public override readonly int GetHashCode()
684684
/// </returns>
685685
public readonly bool Equals(Int2 other)
686686
{
687-
return MathF.Abs(other.X - X) < MathUtil.ZeroTolerance &&
688-
MathF.Abs(other.Y - Y) < MathUtil.ZeroTolerance;
687+
return other.X == X && other.Y == Y;
689688
}
690689

691690
/// <summary>

sources/core/Stride.Core.Mathematics/Int3.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -760,9 +760,7 @@ public override readonly int GetHashCode()
760760
/// </returns>
761761
public readonly bool Equals(Int3 other)
762762
{
763-
return MathF.Abs(other.X - X) < MathUtil.ZeroTolerance &&
764-
MathF.Abs(other.Y - Y) < MathUtil.ZeroTolerance &&
765-
MathF.Abs(other.Z - Z) < MathUtil.ZeroTolerance;
763+
return other.X == X && other.Y == Y && other.Z == Z;
766764
}
767765

768766
/// <summary>

0 commit comments

Comments
 (0)