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

◆ CreateTruncating< TOther >()

static Half INumber< Half >. System.Half.CreateTruncating< TOther > ( TOther value)
inlinestatic

Definition at line 1177 of file Half.cs.

1178 {
1179 if (typeof(TOther) == typeof(byte))
1180 {
1181 return (Half)(int)(byte)(object)value;
1182 }
1183 if (typeof(TOther) == typeof(char))
1184 {
1185 return (Half)(int)(char)(object)value;
1186 }
1187 if (typeof(TOther) == typeof(decimal))
1188 {
1189 return (Half)(float)(decimal)(object)value;
1190 }
1191 if (typeof(TOther) == typeof(double))
1192 {
1193 return (Half)(double)(object)value;
1194 }
1195 if (typeof(TOther) == typeof(short))
1196 {
1197 return (Half)(short)(object)value;
1198 }
1199 if (typeof(TOther) == typeof(int))
1200 {
1201 return (Half)(int)(object)value;
1202 }
1203 if (typeof(TOther) == typeof(long))
1204 {
1205 return (Half)(long)(object)value;
1206 }
1207 if (typeof(TOther) == typeof(IntPtr))
1208 {
1209 return (Half)(nint)(IntPtr)(object)value;
1210 }
1211 if (typeof(TOther) == typeof(sbyte))
1212 {
1213 return (Half)(sbyte)(object)value;
1214 }
1215 if (typeof(TOther) == typeof(float))
1216 {
1217 return (Half)(float)(object)value;
1218 }
1219 if (typeof(TOther) == typeof(ushort))
1220 {
1221 return (Half)(int)(ushort)(object)value;
1222 }
1223 if (typeof(TOther) == typeof(uint))
1224 {
1225 return (Half)(uint)(object)value;
1226 }
1227 if (typeof(TOther) == typeof(ulong))
1228 {
1229 return (Half)(ulong)(object)value;
1230 }
1231 if (typeof(TOther) == typeof(UIntPtr))
1232 {
1233 return (Half)(nuint)(UIntPtr)(object)value;
1234 }
1235 ThrowHelper.ThrowNotSupportedException();
1236 return default(Half);
1237 }
Half(ushort value)
Definition Half.cs:78

References System.ThrowHelper.ThrowNotSupportedException(), and System.value.