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

◆ ScalarAbs()

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

Definition at line 2090 of file Vector.cs.

2091 {
2092 if (typeof(T) == typeof(sbyte))
2093 {
2094 return (T)(object)Math.Abs((sbyte)(object)value);
2095 }
2096 if (typeof(T) == typeof(short))
2097 {
2098 return (T)(object)Math.Abs((short)(object)value);
2099 }
2100 if (typeof(T) == typeof(int))
2101 {
2102 return (T)(object)Math.Abs((int)(object)value);
2103 }
2104 if (typeof(T) == typeof(long))
2105 {
2106 return (T)(object)Math.Abs((long)(object)value);
2107 }
2108 if (typeof(T) == typeof(float))
2109 {
2110 return (T)(object)Math.Abs((float)(object)value);
2111 }
2112 if (typeof(T) == typeof(double))
2113 {
2114 return (T)(object)Math.Abs((double)(object)value);
2115 }
2116 if (typeof(T) == typeof(IntPtr))
2117 {
2118 return (T)(object)Math.Abs((IntPtr)(object)value);
2119 }
2120 throw new NotSupportedException(SR.Arg_TypeNotSupported);
2121 }

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

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