mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
53 lines
1.4 KiB
C#
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;
|
|
}
|
|
}
|