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

◆ CreateSaturating< TOther >()

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

Definition at line 1113 of file Half.cs.

1114 {
1115 if (typeof(TOther) == typeof(byte))
1116 {
1117 return (Half)(int)(byte)(object)value;
1118 }
1119 if (typeof(TOther) == typeof(char))
1120 {
1121 return (Half)(int)(char)(object)value;
1122 }
1123 if (typeof(TOther) == typeof(decimal))
1124 {
1125 return (Half)(float)(decimal)(object)value;
1126 }
1127 if (typeof(TOther) == typeof(double))
1128 {
1129 return (Half)(double)(object)value;
1130 }
1131 if (typeof(TOther) == typeof(short))
1132 {
1133 return (Half)(short)(object)value;
1134 }
1135 if (typeof(TOther) == typeof(int))
1136 {
1137 return (Half)(int)(object)value;
1138 }
1139 if (typeof(TOther) == typeof(long))
1140 {
1141 return (Half)(long)(object)value;
1142 }
1143 if (typeof(TOther) == typeof(IntPtr))
1144 {
1145 return (Half)(nint)(IntPtr)(object)value;
1146 }
1147 if (typeof(TOther) == typeof(sbyte))
1148 {
1149 return (Half)(sbyte)(object)value;
1150 }
1151 if (typeof(TOther) == typeof(float))
1152 {
1153 return (Half)(float)(object)value;
1154 }
1155 if (typeof(TOther) == typeof(ushort))
1156 {
1157 return (Half)(int)(ushort)(object)value;
1158 }
1159 if (typeof(TOther) == typeof(uint))
1160 {
1161 return (Half)(uint)(object)value;
1162 }
1163 if (typeof(TOther) == typeof(ulong))
1164 {
1165 return (Half)(ulong)(object)value;
1166 }
1167 if (typeof(TOther) == typeof(UIntPtr))
1168 {
1169 return (Half)(nuint)(UIntPtr)(object)value;
1170 }
1171 ThrowHelper.ThrowNotSupportedException();
1172 return default(Half);
1173 }
Half(ushort value)
Definition Half.cs:78

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