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

◆ ToInt64() [1/3]

static long System.Decimal.ToInt64 ( decimal d)
inlinestatic

Definition at line 2712 of file Decimal.cs.

2713 {
2714 Truncate(ref d);
2715 if (d.High == 0)
2716 {
2717 long low = (long)d.Low64;
2718 if (!d.IsNegative)
2719 {
2720 if (low >= 0)
2721 {
2722 return low;
2723 }
2724 }
2725 else
2726 {
2727 low = -low;
2728 if (low <= 0)
2729 {
2730 return low;
2731 }
2732 }
2733 }
2734 throw new OverflowException(SR.Overflow_Int64);
2735 }
static decimal Truncate(decimal d)
Definition Decimal.cs:2792

References System.Runtime.Serialization.Dictionary, System.SR.Overflow_Int64, and System.Decimal.Truncate().

Referenced by System.Decimal.operator long().