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

◆ TryRunShortest()

static bool System.Number.Grisu3.TryRunShortest ( in DiyFp boundaryMinus,
in DiyFp w,
in DiyFp boundaryPlus,
Span< byte > buffer,
out int length,
out int decimalExponent )
inlinestaticprivate

Definition at line 935 of file Number.cs.

936 {
937 int minExponent = -60 - (w.e + 64);
938 int maxExponent = -32 - (w.e + 64);
939 int decimalExponent2;
940 DiyFp other = GetCachedPowerForBinaryExponentRange(minExponent, maxExponent, out decimalExponent2);
941 DiyFp w2 = w.Multiply(in other);
942 DiyFp low = boundaryMinus.Multiply(in other);
943 DiyFp high = boundaryPlus.Multiply(in other);
944 int kappa;
945 bool result = TryDigitGenShortest(in low, in w2, in high, buffer, out length, out kappa);
946 decimalExponent = -decimalExponent2 + kappa;
947 return result;
948 }
static bool TryDigitGenShortest(in DiyFp low, in DiyFp w, in DiyFp high, Span< byte > buffer, out int length, out int kappa)
Definition Number.cs:1017
static DiyFp GetCachedPowerForBinaryExponentRange(int minExponent, int maxExponent, out int decimalExponent)
Definition Number.cs:1057

References System.buffer, System.Number.Grisu3.GetCachedPowerForBinaryExponentRange(), System.length, System.Number.DiyFp.Multiply(), System.other, and System.Number.Grisu3.TryDigitGenShortest().

Referenced by System.Number.Grisu3.TryRunDouble(), System.Number.Grisu3.TryRunHalf(), and System.Number.Grisu3.TryRunSingle().