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

◆ CreateTruncating< TOther >()

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

Definition at line 1002 of file Double.cs.

1003 {
1004 if (typeof(TOther) == typeof(byte))
1005 {
1006 return (int)(byte)(object)value;
1007 }
1008 if (typeof(TOther) == typeof(char))
1009 {
1010 return (int)(char)(object)value;
1011 }
1012 if (typeof(TOther) == typeof(decimal))
1013 {
1014 return (double)(decimal)(object)value;
1015 }
1016 if (typeof(TOther) == typeof(double))
1017 {
1018 return (double)(object)value;
1019 }
1020 if (typeof(TOther) == typeof(short))
1021 {
1022 return (short)(object)value;
1023 }
1024 if (typeof(TOther) == typeof(int))
1025 {
1026 return (int)(object)value;
1027 }
1028 if (typeof(TOther) == typeof(long))
1029 {
1030 return (long)(object)value;
1031 }
1032 if (typeof(TOther) == typeof(IntPtr))
1033 {
1034 return (nint)(IntPtr)(object)value;
1035 }
1036 if (typeof(TOther) == typeof(sbyte))
1037 {
1038 return (sbyte)(object)value;
1039 }
1040 if (typeof(TOther) == typeof(float))
1041 {
1042 return (float)(object)value;
1043 }
1044 if (typeof(TOther) == typeof(ushort))
1045 {
1046 return (int)(ushort)(object)value;
1047 }
1048 if (typeof(TOther) == typeof(uint))
1049 {
1050 return (uint)(object)value;
1051 }
1052 if (typeof(TOther) == typeof(ulong))
1053 {
1054 return (ulong)(object)value;
1055 }
1056 if (typeof(TOther) == typeof(UIntPtr))
1057 {
1058 return (nint)(nuint)(UIntPtr)(object)value;
1059 }
1060 ThrowHelper.ThrowNotSupportedException();
1061 return 0.0;
1062 }

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