Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DecimalUtilities.cs
Go to the documentation of this file.
1
namespace
System.Reflection.Internal
;
2
3
internal
static
class
DecimalUtilities
4
{
5
public
static
int
GetScale
(
this
decimal
value
)
6
{
7
Span<int>
destination
= stackalloc
int
[4];
8
decimal.GetBits(
value
,
destination
);
9
return
(
byte
)(
destination
[3] >> 16);
10
}
11
12
public
static
void
GetBits
(
this
decimal
value
, out
bool
isNegative, out
byte
scale, out uint low, out uint mid, out uint high)
13
{
14
Span<int>
destination
= stackalloc
int
[4];
15
decimal.GetBits(
value
,
destination
);
16
low = (uint)
destination
[0];
17
mid = (uint)
destination
[1];
18
high = (uint)
destination
[2];
19
scale = (byte)(
destination
[3] >> 16);
20
isNegative = (
destination
[3] & 0x80000000u) != 0;
21
}
22
}
System.Reflection.Internal.DecimalUtilities.GetBits
static void GetBits(this decimal value, out bool isNegative, out byte scale, out uint low, out uint mid, out uint high)
Definition
DecimalUtilities.cs:12
System.Reflection.Internal.DecimalUtilities.GetScale
static int GetScale(this decimal value)
Definition
DecimalUtilities.cs:5
System.Reflection.Internal.DecimalUtilities
Definition
DecimalUtilities.cs:4
System.Reflection.Internal
Definition
AbstractMemoryBlock.cs:4
System.ExceptionArgument.value
@ value
System.ExceptionArgument.destination
@ destination
System.Span
Definition
Span.cs:14
source
System.Reflection.Metadata
System.Reflection.Internal
DecimalUtilities.cs
Generated by
1.10.0