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