Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetAllBitsSetValue()

static T System.Numerics.Vector< T >.GetAllBitsSetValue ( )
inlinestaticprivate

Definition at line 2036 of file Vector.cs.

2037 {
2038 if (typeof(T) == typeof(byte))
2039 {
2040 return (T)(object)byte.MaxValue;
2041 }
2042 if (typeof(T) == typeof(sbyte))
2043 {
2044 return (T)(object)(sbyte)(-1);
2045 }
2046 if (typeof(T) == typeof(ushort))
2047 {
2048 return (T)(object)ushort.MaxValue;
2049 }
2050 if (typeof(T) == typeof(short))
2051 {
2052 return (T)(object)(short)(-1);
2053 }
2054 if (typeof(T) == typeof(uint))
2055 {
2056 return (T)(object)uint.MaxValue;
2057 }
2058 if (typeof(T) == typeof(int))
2059 {
2060 return (T)(object)(-1);
2061 }
2062 if (typeof(T) == typeof(ulong))
2063 {
2064 return (T)(object)ulong.MaxValue;
2065 }
2066 if (typeof(T) == typeof(long))
2067 {
2068 return (T)(object)(-1L);
2069 }
2070 if (typeof(T) == typeof(float))
2071 {
2072 return (T)(object)BitConverter.Int32BitsToSingle(-1);
2073 }
2074 if (typeof(T) == typeof(double))
2075 {
2076 return (T)(object)BitConverter.Int64BitsToDouble(-1L);
2077 }
2078 if (typeof(T) == typeof(UIntPtr))
2079 {
2080 return (T)(object)UIntPtr.MaxValue;
2081 }
2082 if (typeof(T) == typeof(IntPtr))
2083 {
2084 return (T)(object)(nint)(-1);
2085 }
2086 throw new NotSupportedException(SR.Arg_TypeNotSupported);
2087 }

References System.SR.Arg_TypeNotSupported, System.BitConverter.Int32BitsToSingle(), System.BitConverter.Int64BitsToDouble(), System.L, and System.UIntPtr.MaxValue.

Referenced by System.Numerics.Vector< T >.Equals(), System.Numerics.Vector< T >.GreaterThan(), System.Numerics.Vector< T >.GreaterThanOrEqual(), System.Numerics.Vector< T >.LessThan(), and System.Numerics.Vector< T >.LessThanOrEqual().