// - edit Vector.numerics-binary.tt to modify
#nullable enable
namespace Brutal.Numerics;
// IBinaryNumber
public partial struct double2 : IBinaryNumber
{
/// Determines if every component of a value is a power of two.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static bool IBinaryNumber.IsPow2(double2 value)
{
return double.IsPow2(value.X) && double.IsPow2(value.Y);
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static double2 IBitwiseOperators.operator &(double2 a, double2 b)
{
return Unsafe.BitCast(Unsafe.BitCast(a) & Unsafe.BitCast(b));
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static double2 IBitwiseOperators.operator |(double2 a, double2 b)
{
return Unsafe.BitCast(Unsafe.BitCast(a) | Unsafe.BitCast(b));
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static double2 IBitwiseOperators.operator ^(double2 a, double2 b)
{
return Unsafe.BitCast(Unsafe.BitCast(a) ^ Unsafe.BitCast(b));
}
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
static double2 IBitwiseOperators.operator ~(double2 value)
{
return Unsafe.BitCast(~Unsafe.BitCast(value));
}
}
// the componentwise predicate mask (no interface to mirror) - the per-lane truth IsPow2 collapses
public partial struct double2
{
/// Determines which components of a value are powers of two.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool2 IsPow2(double2 value)
{
return new bool2(double.IsPow2(value.X), double.IsPow2(value.Y));
}
}