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 }