brutal/Brutal.Numerics/Vector/bool2/bool2.numerics.gen.cs
Rian Drake b578433e37 first
2026-10-15 17:10:50 +13:00

53 lines
1.4 KiB
C#

// <auto-generated /> - edit Vector.numerics.tt to modify
#nullable enable
namespace Brutal.Numerics;
// INumberBase
public partial struct bool2
{
/// <inheritdoc />
public static bool2 Zero => new(false);
/// <inheritdoc />
public static bool2 One => new(true);
}
// IBitwiseOperators
public partial struct bool2 : IBitwiseOperators<bool2, bool2, bool2>
{
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator |(bool2 a, bool2 b)
{
return new bool2(a.X | b.X, a.Y | b.Y);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator &(bool2 a, bool2 b)
{
return new bool2(a.X & b.X, a.Y & b.Y);
}
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator ^(bool2 a, bool2 b)
{
return new bool2(a.X ^ b.X, a.Y ^ b.Y);
}
/// <inheritdoc cref="IBitwiseOperators{TSelf, TOther, TResult}.op_OnesComplement" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 operator !(bool2 value)
{
return new bool2(!value.X, !value.Y);
}
// bool has no ~; the interface's complement is componentwise logical not
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static bool2 IBitwiseOperators<bool2, bool2, bool2>.operator ~(bool2 value)
{
return !value;
}
}