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

◆ Unscale()

static void System.Decimal.DecCalc.Unscale ( ref uint low,
ref ulong high64,
ref int scale )
inlinestaticprivate

Definition at line 370 of file Decimal.cs.

371 {
372 while ((byte)low == 0 && scale >= 8 && Div96ByConst(ref high64, ref low, 100000000u))
373 {
374 scale -= 8;
375 }
376 if ((low & 0xF) == 0 && scale >= 4 && Div96ByConst(ref high64, ref low, 10000u))
377 {
378 scale -= 4;
379 }
380 if ((low & 3) == 0 && scale >= 2 && Div96ByConst(ref high64, ref low, 100u))
381 {
382 scale -= 2;
383 }
384 if ((low & 1) == 0 && scale >= 1 && Div96ByConst(ref high64, ref low, 10u))
385 {
386 scale--;
387 }
388 }
static bool Div96ByConst(ref ulong high64, ref uint low, uint pow)
Definition Decimal.cs:356

References System.Runtime.Serialization.Dictionary, and System.Decimal.DecCalc.Div96ByConst().

Referenced by System.Decimal.DecCalc.GetHashCode(), and System.Decimal.DecCalc.VarDecDiv().