mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 12:38:24 +01:00
545 lines
19 KiB
C#
545 lines
19 KiB
C#
// <auto-generated /> - edit Vector.numerics.tt to modify
|
|
#nullable enable
|
|
|
|
namespace Brutal.Numerics;
|
|
|
|
// INumberBase
|
|
public partial struct float2 : INumberBase<float2>
|
|
{
|
|
/// <inheritdoc />
|
|
public static float2 Zero => new(0);
|
|
|
|
/// <inheritdoc />
|
|
public static float2 One => new(1);
|
|
|
|
static float2 IAdditiveIdentity<float2, float2>.AdditiveIdentity => Zero;
|
|
|
|
static float2 IMultiplicativeIdentity<float2, float2>.MultiplicativeIdentity => One;
|
|
|
|
static int INumberBase<float2>.Radix => 2; // every component type is binary
|
|
|
|
/// <inheritdoc cref="Vector2.Abs" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 Abs(float2 value)
|
|
{
|
|
return new(float.Abs(value.X), float.Abs(value.Y));
|
|
}
|
|
|
|
static bool INumberBase<float2>.IsCanonical(float2 value) => true;
|
|
|
|
static bool INumberBase<float2>.IsComplexNumber(float2 value) => false;
|
|
|
|
static bool INumberBase<float2>.IsImaginaryNumber(float2 value) => false;
|
|
|
|
/// <summary>Determines if every component of a value is zero.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<float2>.IsZero(float2 value)
|
|
{
|
|
return value == Zero;
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is an even integral value.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<float2>.IsEvenInteger(float2 value)
|
|
{
|
|
return float.IsEvenInteger(value.X) && float.IsEvenInteger(value.Y);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is an odd integral value.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<float2>.IsOddInteger(float2 value)
|
|
{
|
|
return float.IsOddInteger(value.X) && float.IsOddInteger(value.Y);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is negative.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<float2>.IsNegative(float2 value)
|
|
{
|
|
return float.IsNegative(value.X) && float.IsNegative(value.Y);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is positive.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<float2>.IsPositive(float2 value)
|
|
{
|
|
return float.IsPositive(value.X) && float.IsPositive(value.Y);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is finite.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<float2>.IsFinite(float2 value)
|
|
{
|
|
return float.IsFinite(value.X) && float.IsFinite(value.Y);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is infinite.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<float2>.IsInfinity(float2 value)
|
|
{
|
|
return float.IsInfinity(value.X) && float.IsInfinity(value.Y);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is negative infinity.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<float2>.IsNegativeInfinity(float2 value)
|
|
{
|
|
return float.IsNegativeInfinity(value.X) && float.IsNegativeInfinity(value.Y);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is positive infinity.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<float2>.IsPositiveInfinity(float2 value)
|
|
{
|
|
return float.IsPositiveInfinity(value.X) && float.IsPositiveInfinity(value.Y);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is an integral value.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<float2>.IsInteger(float2 value)
|
|
{
|
|
return float.IsInteger(value.X) && float.IsInteger(value.Y);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is a real value.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<float2>.IsRealNumber(float2 value)
|
|
{
|
|
return float.IsRealNumber(value.X) && float.IsRealNumber(value.Y);
|
|
}
|
|
|
|
/// <summary>Determines if any component of a value is NaN.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<float2>.IsNaN(float2 value)
|
|
{
|
|
return float.IsNaN(value.X) || float.IsNaN(value.Y);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is normal.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<float2>.IsNormal(float2 value)
|
|
{
|
|
return float.IsNormal(value.X) && float.IsNormal(value.Y);
|
|
}
|
|
|
|
/// <summary>Determines if every component of a value is subnormal.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
static bool INumberBase<float2>.IsSubnormal(float2 value)
|
|
{
|
|
return float.IsSubnormal(value.X) && float.IsSubnormal(value.Y);
|
|
}
|
|
|
|
/// <summary>Computes, componentwise, the value whose magnitude is greater.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 MaxMagnitude(float2 a, float2 b)
|
|
{
|
|
return new(float.MaxMagnitude(a.X, b.X), float.MaxMagnitude(a.Y, b.Y));
|
|
}
|
|
|
|
/// <summary>Computes, componentwise, the value whose magnitude is greater, preferring numbers over NaN.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 MaxMagnitudeNumber(float2 a, float2 b)
|
|
{
|
|
return new(float.MaxMagnitudeNumber(a.X, b.X), float.MaxMagnitudeNumber(a.Y, b.Y));
|
|
}
|
|
|
|
/// <summary>Computes, componentwise, the value whose magnitude is smaller.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 MinMagnitude(float2 a, float2 b)
|
|
{
|
|
return new(float.MinMagnitude(a.X, b.X), float.MinMagnitude(a.Y, b.Y));
|
|
}
|
|
|
|
/// <summary>Computes, componentwise, the value whose magnitude is smaller, preferring numbers over NaN.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 MinMagnitudeNumber(float2 a, float2 b)
|
|
{
|
|
return new(float.MinMagnitudeNumber(a.X, b.X), float.MinMagnitudeNumber(a.Y, b.Y));
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector2.Add" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 Add(float2 a, float2 b)
|
|
{
|
|
return a + b;
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector2.Divide(Vector2, Vector2)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 Divide(float2 a, float2 b)
|
|
{
|
|
return a / b;
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector2.Multiply(Vector2, Vector2)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 Multiply(float2 a, float2 b)
|
|
{
|
|
return a * b;
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector2.Negate" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 Negate(float2 value)
|
|
{
|
|
return -value;
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector2.Subtract" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 Subtract(float2 a, float2 b)
|
|
{
|
|
return a - b;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 operator +(float2 a, float2 b)
|
|
{
|
|
return new(a.X + b.X, a.Y + b.Y);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 operator -(float2 a, float2 b)
|
|
{
|
|
return new(a.X - b.X, a.Y - b.Y);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 operator *(float2 a, float2 b)
|
|
{
|
|
return new(a.X * b.X, a.Y * b.Y);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 operator /(float2 a, float2 b)
|
|
{
|
|
return new(a.X / b.X, a.Y / b.Y);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 operator -(float2 a)
|
|
{
|
|
return new(-a.X, -a.Y);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 operator +(float2 a)
|
|
{
|
|
return a;
|
|
}
|
|
|
|
// ++/-- are well-defined (+/- One) but a footgun on a concrete vector: generic-plane only.
|
|
|
|
static float2 IIncrementOperators<float2>.operator ++(float2 value) => value + One;
|
|
|
|
static float2 IDecrementOperators<float2>.operator --(float2 value) => value - One;
|
|
|
|
|
|
static bool INumberBase<float2>.TryConvertFromChecked<TOther>(TOther value, out float2 result)
|
|
{
|
|
return NumberConversion.TryConvertFrom<float2, float, TOther, NumberConversion.Checked>(value, out result);
|
|
}
|
|
|
|
static bool INumberBase<float2>.TryConvertToChecked<TOther>(float2 value, [MaybeNullWhen(false)] out TOther result)
|
|
{
|
|
result = default;
|
|
return false;
|
|
}
|
|
|
|
static bool INumberBase<float2>.TryConvertFromSaturating<TOther>(TOther value, out float2 result)
|
|
{
|
|
return NumberConversion.TryConvertFrom<float2, float, TOther, NumberConversion.Saturating>(value, out result);
|
|
}
|
|
|
|
static bool INumberBase<float2>.TryConvertToSaturating<TOther>(float2 value, [MaybeNullWhen(false)] out TOther result)
|
|
{
|
|
result = default;
|
|
return false;
|
|
}
|
|
|
|
static bool INumberBase<float2>.TryConvertFromTruncating<TOther>(TOther value, out float2 result)
|
|
{
|
|
return NumberConversion.TryConvertFrom<float2, float, TOther, NumberConversion.Truncating>(value, out result);
|
|
}
|
|
|
|
static bool INumberBase<float2>.TryConvertToTruncating<TOther>(float2 value, [MaybeNullWhen(false)] out TOther result)
|
|
{
|
|
result = default;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// IMultiplyOperators<TSelf, TComponent, TSelf>, IDivisionOperators<TSelf, TComponent, TSelf>
|
|
public partial struct float2
|
|
: IMultiplyOperators<float2, float, float2>
|
|
, IDivisionOperators<float2, float, float2>
|
|
{
|
|
/// <inheritdoc cref="Vector2.Divide(Vector2, float)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 Divide(float2 a, float b)
|
|
{
|
|
return a / b;
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector2.Multiply(Vector2, float)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 Multiply(float2 a, float b)
|
|
{
|
|
return a * b;
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector2.Multiply(float, Vector2)" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 Multiply(float a, float2 b)
|
|
{
|
|
return a * b;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 operator *(float2 a, float b)
|
|
{
|
|
return new(a.X * b, a.Y * b);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 operator /(float2 a, float b)
|
|
{
|
|
return new(a.X / b, a.Y / b);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 operator *(float a, float2 b)
|
|
{
|
|
return new(a * b.X, a * b.Y);
|
|
}
|
|
}
|
|
|
|
// INumber
|
|
public partial struct float2 : INumber<float2>
|
|
{
|
|
/// <inheritdoc cref="Vector2.Clamp" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 Clamp(float2 value, float2 min, float2 max)
|
|
{
|
|
// HLSL contract when min > max: max wins (clamp is Max-then-Min); pinned in
|
|
// Clamp_InvertedBounds_MatchesBcl. NOT scalar T.Clamp, which throws on inversion.
|
|
return Min(Max(value, min), max);
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector2.Max" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 Max(float2 a, float2 b)
|
|
{
|
|
return new(float.Max(a.X, b.X), float.Max(a.Y, b.Y));
|
|
}
|
|
|
|
/// <inheritdoc cref="Vector2.Min" />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 Min(float2 a, float2 b)
|
|
{
|
|
return new(float.Min(a.X, b.X), float.Min(a.Y, b.Y));
|
|
}
|
|
|
|
/// <summary>Selects, componentwise, the larger value, preferring numbers over NaN.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 MaxNumber(float2 a, float2 b)
|
|
{
|
|
return new(float.MaxNumber(a.X, b.X), float.MaxNumber(a.Y, b.Y));
|
|
}
|
|
|
|
/// <summary>Selects, componentwise, the smaller value, preferring numbers over NaN.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 MinNumber(float2 a, float2 b)
|
|
{
|
|
return new(float.MinNumber(a.X, b.X), float.MinNumber(a.Y, b.Y));
|
|
}
|
|
|
|
/// <summary>Copies, componentwise, the sign of <paramref name="sign" /> onto the magnitude of <paramref name="value" />.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 CopySign(float2 value, float2 sign)
|
|
{
|
|
return new(float.CopySign(value.X, sign.X), float.CopySign(value.Y, sign.Y));
|
|
}
|
|
|
|
// the Native variants permit either NaN/signed-zero behavior - forwarding is always legal
|
|
static float2 INumber<float2>.ClampNative(float2 value, float2 min, float2 max) => Clamp(value, min, max);
|
|
|
|
static float2 INumber<float2>.MaxNative(float2 a, float2 b) => Max(a, b);
|
|
|
|
static float2 INumber<float2>.MinNative(float2 a, float2 b) => Min(a, b);
|
|
|
|
// Sign's int return cannot hold a per-lane answer, and a collapsed one would lie for mixed signs
|
|
static int INumber<float2>.Sign(float2 value) =>
|
|
throw new NotSupportedException($"{nameof(float2)} has no scalar sign.");
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static float2 operator %(float2 a, float2 b)
|
|
{
|
|
return new float2(a.X % b.X, a.Y % b.Y);
|
|
}
|
|
|
|
int IComparable.CompareTo(object? obj) =>
|
|
throw new NotSupportedException($"{nameof(float2)} has no total order.");
|
|
|
|
int IComparable<float2>.CompareTo(float2 other) =>
|
|
throw new NotSupportedException($"{nameof(float2)} has no total order.");
|
|
|
|
static bool IComparisonOperators<float2, float2, bool>.operator <(float2 a, float2 b) =>
|
|
throw new NotSupportedException($"{nameof(float2)} has no total order.");
|
|
|
|
static bool IComparisonOperators<float2, float2, bool>.operator <=(float2 a, float2 b) =>
|
|
throw new NotSupportedException($"{nameof(float2)} has no total order.");
|
|
|
|
static bool IComparisonOperators<float2, float2, bool>.operator >(float2 a, float2 b) =>
|
|
throw new NotSupportedException($"{nameof(float2)} has no total order.");
|
|
|
|
static bool IComparisonOperators<float2, float2, bool>.operator >=(float2 a, float2 b) =>
|
|
throw new NotSupportedException($"{nameof(float2)} has no total order.");
|
|
}
|
|
|
|
// IComponentwiseComparison + the componentwise predicate masks (no interface to mirror)
|
|
public partial struct float2 : IComponentwiseComparison<float2, bool2>
|
|
{
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 operator <(float2 a, float2 b)
|
|
{
|
|
return new bool2(a.X < b.X, a.Y < b.Y);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 operator <=(float2 a, float2 b)
|
|
{
|
|
return new bool2(a.X <= b.X, a.Y <= b.Y);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 operator >(float2 a, float2 b)
|
|
{
|
|
return new bool2(a.X > b.X, a.Y > b.Y);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 operator >=(float2 a, float2 b)
|
|
{
|
|
return new bool2(a.X >= b.X, a.Y >= b.Y);
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are zero.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 IsZero(float2 value)
|
|
{
|
|
return new bool2(value.X == 0, value.Y == 0);
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are an even integral value.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 IsEvenInteger(float2 value)
|
|
{
|
|
return new bool2(float.IsEvenInteger(value.X), float.IsEvenInteger(value.Y));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are an odd integral value.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 IsOddInteger(float2 value)
|
|
{
|
|
return new bool2(float.IsOddInteger(value.X), float.IsOddInteger(value.Y));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are negative.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 IsNegative(float2 value)
|
|
{
|
|
return new bool2(float.IsNegative(value.X), float.IsNegative(value.Y));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are positive.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 IsPositive(float2 value)
|
|
{
|
|
return new bool2(float.IsPositive(value.X), float.IsPositive(value.Y));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are finite.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 IsFinite(float2 value)
|
|
{
|
|
return new bool2(float.IsFinite(value.X), float.IsFinite(value.Y));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are infinite.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 IsInfinity(float2 value)
|
|
{
|
|
return new bool2(float.IsInfinity(value.X), float.IsInfinity(value.Y));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are negative infinity.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 IsNegativeInfinity(float2 value)
|
|
{
|
|
return new bool2(float.IsNegativeInfinity(value.X), float.IsNegativeInfinity(value.Y));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are positive infinity.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 IsPositiveInfinity(float2 value)
|
|
{
|
|
return new bool2(float.IsPositiveInfinity(value.X), float.IsPositiveInfinity(value.Y));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are an integral value.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 IsInteger(float2 value)
|
|
{
|
|
return new bool2(float.IsInteger(value.X), float.IsInteger(value.Y));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are a real value.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 IsRealNumber(float2 value)
|
|
{
|
|
return new bool2(float.IsRealNumber(value.X), float.IsRealNumber(value.Y));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are NaN.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 IsNaN(float2 value)
|
|
{
|
|
return new bool2(float.IsNaN(value.X), float.IsNaN(value.Y));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are normal.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 IsNormal(float2 value)
|
|
{
|
|
return new bool2(float.IsNormal(value.X), float.IsNormal(value.Y));
|
|
}
|
|
|
|
/// <summary>Determines which components of a value are subnormal.</summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool2 IsSubnormal(float2 value)
|
|
{
|
|
return new bool2(float.IsSubnormal(value.X), float.IsSubnormal(value.Y));
|
|
}
|
|
}
|
|
|
|
// ISignedNumber
|
|
public partial struct float2 : ISignedNumber<float2>
|
|
{
|
|
/// <inheritdoc />
|
|
public static float2 NegativeOne => new(-1);
|
|
}
|