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

◆ Create< TOther >()

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

Definition at line 874 of file Double.cs.

875 {
876 if (typeof(TOther) == typeof(byte))
877 {
878 return (int)(byte)(object)value;
879 }
880 if (typeof(TOther) == typeof(char))
881 {
882 return (int)(char)(object)value;
883 }
884 if (typeof(TOther) == typeof(decimal))
885 {
886 return (double)(decimal)(object)value;
887 }
888 if (typeof(TOther) == typeof(double))
889 {
890 return (double)(object)value;
891 }
892 if (typeof(TOther) == typeof(short))
893 {
894 return (short)(object)value;
895 }
896 if (typeof(TOther) == typeof(int))
897 {
898 return (int)(object)value;
899 }
900 if (typeof(TOther) == typeof(long))
901 {
902 return (long)(object)value;
903 }
904 if (typeof(TOther) == typeof(IntPtr))
905 {
906 return (nint)(IntPtr)(object)value;
907 }
908 if (typeof(TOther) == typeof(sbyte))
909 {
910 return (sbyte)(object)value;
911 }
912 if (typeof(TOther) == typeof(float))
913 {
914 return (float)(object)value;
915 }
916 if (typeof(TOther) == typeof(ushort))
917 {
918 return (int)(ushort)(object)value;
919 }
920 if (typeof(TOther) == typeof(uint))
921 {
922 return (uint)(object)value;
923 }
924 if (typeof(TOther) == typeof(ulong))
925 {
926 return (ulong)(object)value;
927 }
928 if (typeof(TOther) == typeof(UIntPtr))
929 {
930 return (nint)(nuint)(UIntPtr)(object)value;
931 }
932 ThrowHelper.ThrowNotSupportedException();
933 return 0.0;
934 }

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