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

◆ ToInt16() [1/3]

static short System.Decimal.ToInt16 ( decimal value)
inlinestatic

Definition at line 2663 of file Decimal.cs.

2664 {
2665 int num;
2666 try
2667 {
2668 num = ToInt32(value);
2669 }
2670 catch (OverflowException)
2671 {
2672 Number.ThrowOverflowException(TypeCode.Int16);
2673 throw;
2674 }
2675 if (num != (short)num)
2676 {
2677 Number.ThrowOverflowException(TypeCode.Int16);
2678 }
2679 return (short)num;
2680 }
static int ToInt32(decimal d)
Definition Decimal.cs:2687

References System.Number.ThrowOverflowException(), System.Decimal.ToInt32(), and System.value.

Referenced by System.Decimal.operator short().