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

◆ ScalarSqrt()

static T System.Numerics.Vector< T >.ScalarSqrt ( T value)
inlinestaticprivate

Definition at line 2124 of file Vector.cs.

2125 {
2126 if (typeof(T) == typeof(byte))
2127 {
2128 return (T)(object)(byte)Math.Sqrt((int)(byte)(object)value);
2129 }
2130 if (typeof(T) == typeof(sbyte))
2131 {
2132 return (T)(object)(sbyte)Math.Sqrt((sbyte)(object)value);
2133 }
2134 if (typeof(T) == typeof(ushort))
2135 {
2136 return (T)(object)(ushort)Math.Sqrt((int)(ushort)(object)value);
2137 }
2138 if (typeof(T) == typeof(short))
2139 {
2140 return (T)(object)(short)Math.Sqrt((short)(object)value);
2141 }
2142 if (typeof(T) == typeof(uint))
2143 {
2144 return (T)(object)(uint)Math.Sqrt((uint)(object)value);
2145 }
2146 if (typeof(T) == typeof(int))
2147 {
2148 return (T)(object)(int)Math.Sqrt((int)(object)value);
2149 }
2150 if (typeof(T) == typeof(ulong))
2151 {
2152 return (T)(object)(ulong)Math.Sqrt((ulong)(object)value);
2153 }
2154 if (typeof(T) == typeof(long))
2155 {
2156 return (T)(object)(long)Math.Sqrt((long)(object)value);
2157 }
2158 if (typeof(T) == typeof(float))
2159 {
2160 return (T)(object)(float)Math.Sqrt((float)(object)value);
2161 }
2162 if (typeof(T) == typeof(double))
2163 {
2164 return (T)(object)Math.Sqrt((double)(object)value);
2165 }
2166 if (typeof(T) == typeof(UIntPtr))
2167 {
2168 return (T)(object)(UIntPtr)Math.Sqrt((nint)(nuint)(UIntPtr)(object)value);
2169 }
2170 if (typeof(T) == typeof(IntPtr))
2171 {
2172 return (T)(object)(IntPtr)Math.Sqrt((nint)(IntPtr)(object)value);
2173 }
2174 throw new NotSupportedException(SR.Arg_TypeNotSupported);
2175 }

References System.SR.Arg_TypeNotSupported, System.Math.Sqrt(), and System.value.

Referenced by System.Numerics.Vector< T >.SquareRoot().