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