brutal/brutal.numerics/Brutal.Numerics/Vector/float4/float4.equality.gen.cs
2026-10-15 14:12:02 +13:00

41 lines
1.2 KiB
C#

// <auto-generated /> - edit Vector.equality.tt to modify
#nullable enable
namespace Brutal.Numerics;
public partial struct float4
{
/// <inheritdoc />
public readonly override int GetHashCode()
{
return HashCode.Combine(X, Y, Z, W);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly bool Equals(float4 other)
{
return X.Equals(other.X) && Y.Equals(other.Y) && Z.Equals(other.Z) && W.Equals(other.W);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly override bool Equals([NotNullWhen(true)] object? obj)
{
return obj is float4 other && Equals(other);
}
/// <summary>IEEE lane-wise equality over every component: any NaN component makes this false (contrast <see cref="Equals(float4)" />, which is NaN-reflexive), and -0 equals +0.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(float4 a, float4 b)
{
return a.X == b.X && a.Y == b.Y && a.Z == b.Z && a.W == b.W;
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(float4 a, float4 b)
{
return !(a == b);
}
}