14 instantiations of DiyFp
System.Private.CoreLib (14)
src\libraries\System.Private.CoreLib\src\System\Number.DiyFp.cs (8)
46
return new
DiyFp
(f, e);
81
return new
DiyFp
(ac + (ad >> 32) + (bc >> 32) + (tmp >> 32), e + other.e + SignificandSize);
94
return new
DiyFp
(f << lzcnt, e - lzcnt);
104
return new
DiyFp
(f - other.f, e);
109
mPlus = new
DiyFp
((f << 1) + 1, e - 1).Normalize();
124
mMinus = new
DiyFp
((f << 2) - 1, e - 2);
128
mMinus = new
DiyFp
((f << 1) - 1, e - 1);
131
mMinus = new
DiyFp
(mMinus.f << (mMinus.e - mPlus.e), mPlus.e);
src\libraries\System.Private.CoreLib\src\System\Number.Grisu3.cs (6)
527
var one = new
DiyFp
(1UL << -w.e, w.e);
705
var tooLow = new
DiyFp
(low.f - unit, low.e);
706
var tooHigh = new
DiyFp
(high.f + unit, high.e);
721
var one = new
DiyFp
(1UL << -w.e, w.e);
789
unsafeInterval = new
DiyFp
(unsafeInterval.f * 10, unsafeInterval.e);
832
return new
DiyFp
(CachedPowersSignificand[index], CachedPowersBinaryExponent[index]);
50 references to DiyFp
System.Private.CoreLib (50)
src\libraries\System.Private.CoreLib\src\System\Number.DiyFp.cs (12)
32
public static
DiyFp
CreateAndGetBoundaries<TNumber>(TNumber value, out
DiyFp
mMinus, out
DiyFp
mPlus)
35
var
result = Create(value);
40
public static
DiyFp
Create<TNumber>(TNumber value)
55
public
DiyFp
Multiply(in
DiyFp
other)
84
public
DiyFp
Normalize()
100
public
DiyFp
Subtract(in
DiyFp
other)
107
private void GetBoundaries(int implicitBitIndex, out
DiyFp
mMinus, out
DiyFp
mPlus)
src\libraries\System.Private.CoreLib\src\System\Number.Grisu3.cs (38)
338
DiyFp
w =
DiyFp
.CreateAndGetBoundaries(v, out
DiyFp
boundaryMinus, out
DiyFp
boundaryPlus).Normalize();
343
DiyFp
w =
DiyFp
.Create(v).Normalize();
362
private static bool TryRunCounted(in
DiyFp
w, int requestedDigits, Span<byte> buffer, out int length, out int decimalExponent)
366
int tenMkMinimalBinaryExponent = MinimalTargetExponent - (w.e +
DiyFp
.SignificandSize);
367
int tenMkMaximalBinaryExponent = MaximalTargetExponent - (w.e +
DiyFp
.SignificandSize);
369
DiyFp
tenMk = GetCachedPowerForBinaryExponentRange(tenMkMinimalBinaryExponent, tenMkMaximalBinaryExponent, out int mk);
371
Debug.Assert(MinimalTargetExponent <= (w.e + tenMk.e +
DiyFp
.SignificandSize));
372
Debug.Assert(MaximalTargetExponent >= (w.e + tenMk.e +
DiyFp
.SignificandSize));
384
DiyFp
scaledW = w.Multiply(in tenMk);
410
private static bool TryRunShortest(in
DiyFp
boundaryMinus, in
DiyFp
w, in
DiyFp
boundaryPlus, Span<byte> buffer, out int length, out int decimalExponent)
418
int tenMkMinimalBinaryExponent = MinimalTargetExponent - (w.e +
DiyFp
.SignificandSize);
419
int tenMkMaximalBinaryExponent = MaximalTargetExponent - (w.e +
DiyFp
.SignificandSize);
421
DiyFp
tenMk = GetCachedPowerForBinaryExponentRange(tenMkMinimalBinaryExponent, tenMkMaximalBinaryExponent, out int mk);
423
Debug.Assert(MinimalTargetExponent <= (w.e + tenMk.e +
DiyFp
.SignificandSize));
424
Debug.Assert(MaximalTargetExponent >= (w.e + tenMk.e +
DiyFp
.SignificandSize));
436
DiyFp
scaledW = w.Multiply(in tenMk);
437
Debug.Assert(scaledW.e == (boundaryPlus.e + tenMk.e +
DiyFp
.SignificandSize));
443
DiyFp
scaledBoundaryMinus = boundaryMinus.Multiply(in tenMk);
444
DiyFp
scaledBoundaryPlus = boundaryPlus.Multiply(in tenMk);
513
private static bool TryDigitGenCounted(in
DiyFp
w, int requestedDigits, Span<byte> buffer, out int length, out int kappa)
527
var
one = new DiyFp(1UL << -w.e, w.e);
550
uint divisor = BiggestPowerTen(integrals,
DiyFp
.SignificandSize - (-one.e), out kappa);
682
private static bool TryDigitGenShortest(in
DiyFp
low, in
DiyFp
w, in
DiyFp
high, Span<byte> buffer, out int length, out int kappa)
705
var
tooLow = new DiyFp(low.f - unit, low.e);
706
var
tooHigh = new DiyFp(high.f + unit, high.e);
710
DiyFp
unsafeInterval = tooHigh.Subtract(in tooLow);
721
var
one = new DiyFp(1UL << -w.e, w.e);
729
uint divisor = BiggestPowerTen(integrals,
DiyFp
.SignificandSize - (-one.e), out kappa);
818
private static
DiyFp
GetCachedPowerForBinaryExponentRange(int minExponent, int maxExponent, out int decimalExponent)
823
double k = Math.Ceiling((minExponent +
DiyFp
.SignificandSize - 1) * D1Log210);