155 references to BigIntegerCalculator
System.Runtime.Numerics (155)
System\Number.BigInteger.cs (34)
358
base1E9Length <=
BigIntegerCalculator
.StackAllocThreshold
359
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
384
resultLength <=
BigIntegerCalculator
.StackAllocThreshold
385
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
417
(uint)powersOf1e9BufferLength <=
BigIntegerCalculator
.StackAllocThreshold
418
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
429
leadingLength <=
BigIntegerCalculator
.StackAllocThreshold
430
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
435
leading = leading.Slice(0,
BigIntegerCalculator
.ActualLength(leading));
456
base1E9 = base1E9.Slice(0,
BigIntegerCalculator
.ActualLength(base1E9));
476
bufferLength <=
BigIntegerCalculator
.StackAllocThreshold
477
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
483
ReadOnlySpan<uint> buffer2 = buffer.Slice(0,
BigIntegerCalculator
.ActualLength(buffer));
485
BigIntegerCalculator
.Multiply(buffer2, multiplier, bitsUpper);
491
BigIntegerCalculator
.AddSelf(bits, buffer.Slice(0,
BigIntegerCalculator
.ActualLength(buffer)));
817
Span<uint> base1E9Buffer = ((uint)base1E9BufferLength <=
BigIntegerCalculator
.StackAllocThreshold ?
973
int ToStringNaiveThreshold =
BigIntegerCalculator
.DivideBurnikelZieglerThreshold;
987
powersOf1e9BufferLength <=
BigIntegerCalculator
.StackAllocThreshold
988
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
1015
while (bits.Length < powOfTen.Length + omittedLength ||
BigIntegerCalculator
.Compare(bits.Slice(omittedLength), powOfTen) < 0)
1024
Span<uint> upper = ((uint)upperLength <=
BigIntegerCalculator
.StackAllocThreshold
1025
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
1030
Span<uint> lower = ((uint)lowerLength <=
BigIntegerCalculator
.StackAllocThreshold
1031
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
1035
BigIntegerCalculator
.Divide(bits.Slice(omittedLength), powOfTen, upper, lower.Slice(omittedLength));
1044
lower.Slice(0,
BigIntegerCalculator
.ActualLength(lower)),
1056
upper.Slice(0,
BigIntegerCalculator
.ActualLength(upper)),
1229
BigIntegerCalculator
.Square(src, dst);
1297
BigIntegerCalculator
.Multiply(left, UInt32PowersOfTen[trailingZeroCount], bits.Slice(0, left.Length + 1));
1304
bits.Length <=
BigIntegerCalculator
.StackAllocThreshold
1305
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
1340
BigIntegerCalculator
.Multiply(src, power, dst);
1358
BigIntegerCalculator
.Multiply(left, powersOfTen, bits2);
System\Numerics\BigInteger.cs (116)
797
Span<uint> quotient = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
798
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
804
BigIntegerCalculator
.Divide(dividend._bits, NumericsHelpers.Abs(divisor._sign), quotient, out rest);
827
Span<uint> rest = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
828
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
833
Span<uint> quotient = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
834
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
837
BigIntegerCalculator
.Divide(dividend._bits, divisor._bits, quotient, rest);
904
return
BigIntegerCalculator
.Gcd(NumericsHelpers.Abs(left._sign), NumericsHelpers.Abs(right._sign));
911
?
BigIntegerCalculator
.Gcd(right._bits, NumericsHelpers.Abs(left._sign))
919
?
BigIntegerCalculator
.Gcd(left._bits, NumericsHelpers.Abs(right._sign))
925
if (
BigIntegerCalculator
.Compare(left._bits, right._bits) < 0)
937
Debug.Assert(
BigIntegerCalculator
.Compare(leftBits, rightBits) >= 0);
945
uint temp =
BigIntegerCalculator
.Remainder(leftBits, rightBits[0]);
946
result =
BigIntegerCalculator
.Gcd(rightBits[0], temp);
950
Span<uint> bits = (leftBits.Length <=
BigIntegerCalculator
.StackAllocThreshold
951
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
954
BigIntegerCalculator
.Remainder(leftBits, rightBits, bits);
959
result =
BigIntegerCalculator
.Gcd(left, right);
963
Span<uint> bits = (leftBits.Length <=
BigIntegerCalculator
.StackAllocThreshold
964
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
967
BigIntegerCalculator
.Gcd(leftBits, rightBits, bits);
1007
uint bits = trivialValue && trivialExponent ?
BigIntegerCalculator
.Pow(NumericsHelpers.Abs(value._sign), NumericsHelpers.Abs(exponent._sign), NumericsHelpers.Abs(modulus._sign)) :
1008
trivialValue ?
BigIntegerCalculator
.Pow(NumericsHelpers.Abs(value._sign), exponent._bits!, NumericsHelpers.Abs(modulus._sign)) :
1009
trivialExponent ?
BigIntegerCalculator
.Pow(value._bits!, NumericsHelpers.Abs(exponent._sign), NumericsHelpers.Abs(modulus._sign)) :
1010
BigIntegerCalculator
.Pow(value._bits!, exponent._bits!, NumericsHelpers.Abs(modulus._sign));
1018
Span<uint> bits = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
1019
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
1026
BigIntegerCalculator
.Pow(NumericsHelpers.Abs(value._sign), NumericsHelpers.Abs(exponent._sign), modulus._bits!, bits);
1030
BigIntegerCalculator
.Pow(NumericsHelpers.Abs(value._sign), exponent._bits!, modulus._bits!, bits);
1035
BigIntegerCalculator
.Pow(value._bits!, NumericsHelpers.Abs(exponent._sign), modulus._bits!, bits);
1039
BigIntegerCalculator
.Pow(value._bits!, exponent._bits!, modulus._bits!, bits);
1077
int size =
BigIntegerCalculator
.PowBound(power, 1);
1078
Span<uint> bits = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
1079
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
1083
BigIntegerCalculator
.Pow(NumericsHelpers.Abs(value._sign), power, bits);
1088
int size =
BigIntegerCalculator
.PowBound(power, value._bits!.Length);
1089
Span<uint> bits = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
1090
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
1094
BigIntegerCalculator
.Pow(value._bits, power, bits);
1220
int bitsResult =
BigIntegerCalculator
.Compare(_bits, other._bits);
1711
Span<uint> bits = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
1712
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
1715
BigIntegerCalculator
.Add(rightBits, NumericsHelpers.Abs(leftSign), bits);
1723
Span<uint> bits = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
1724
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
1727
BigIntegerCalculator
.Add(leftBits, NumericsHelpers.Abs(rightSign), bits);
1735
Span<uint> bits = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
1736
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
1739
BigIntegerCalculator
.Add(rightBits, leftBits, bits);
1747
Span<uint> bits = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
1748
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
1751
BigIntegerCalculator
.Add(leftBits, rightBits, bits);
1789
Span<uint> bits = (size <=
BigIntegerCalculator
.StackAllocThreshold
1790
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
1793
BigIntegerCalculator
.Subtract(rightBits, NumericsHelpers.Abs(leftSign), bits);
1801
Span<uint> bits = (size <=
BigIntegerCalculator
.StackAllocThreshold
1802
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
1805
BigIntegerCalculator
.Subtract(leftBits, NumericsHelpers.Abs(rightSign), bits);
1808
else if (
BigIntegerCalculator
.Compare(leftBits, rightBits) < 0)
1811
Span<uint> bits = (size <=
BigIntegerCalculator
.StackAllocThreshold
1812
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
1815
BigIntegerCalculator
.Subtract(rightBits, leftBits, bits);
1823
Span<uint> bits = (size <=
BigIntegerCalculator
.StackAllocThreshold
1824
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
1827
BigIntegerCalculator
.Subtract(leftBits, rightBits, bits);
2416
Span<uint> x = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
2417
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
2423
Span<uint> y = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
2424
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
2430
Span<uint> z = (size <=
BigIntegerCalculator
.StackAllocThreshold
2431
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
2472
Span<uint> x = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
2473
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
2479
Span<uint> y = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
2480
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
2486
Span<uint> z = (size <=
BigIntegerCalculator
.StackAllocThreshold
2487
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
2523
Span<uint> x = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
2524
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
2530
Span<uint> y = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
2531
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
2537
Span<uint> z = (size <=
BigIntegerCalculator
.StackAllocThreshold
2538
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
2604
BigIntegerCalculator
.LeftShiftSelf(zd, smallShift, out uint carry);
2680
Span<uint> zd = ((uint)zLength <=
BigIntegerCalculator
.StackAllocThreshold
2681
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
2687
BigIntegerCalculator
.RightShiftSelf(zd, smallShift, out uint carry);
2774
Span<uint> bits = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
2775
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
2778
BigIntegerCalculator
.Multiply(right, NumericsHelpers.Abs(leftSign), bits);
2786
Span<uint> bits = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
2787
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
2790
BigIntegerCalculator
.Multiply(left, NumericsHelpers.Abs(rightSign), bits);
2796
Span<uint> bits = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
2797
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
2801
BigIntegerCalculator
.Square(left, bits);
2809
Span<uint> bits = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
2810
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
2814
BigIntegerCalculator
.Multiply(left, right, bits);
2851
Span<uint> quotient = ((uint)size <=
BigIntegerCalculator
.StackAllocThreshold
2852
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
2858
BigIntegerCalculator
.Divide(dividend._bits, NumericsHelpers.Abs(divisor._sign), quotient);
2877
Span<uint> quotient = ((uint)size <
BigIntegerCalculator
.StackAllocThreshold
2878
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
2881
BigIntegerCalculator
.Divide(dividend._bits, divisor._bits, quotient);
2914
uint remainder =
BigIntegerCalculator
.Remainder(dividend._bits, NumericsHelpers.Abs(divisor._sign));
2927
Span<uint> bits = (size <=
BigIntegerCalculator
.StackAllocThreshold
2928
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
2931
BigIntegerCalculator
.Remainder(dividend._bits, divisor._bits, bits);
3324
Span<uint> zd = ((uint)zLength <=
BigIntegerCalculator
.StackAllocThreshold
3325
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
3341
BigIntegerCalculator
.RotateLeft(zd, rotateLeftAmount);
5162
Span<uint> zd = ((uint)zLength <=
BigIntegerCalculator
.StackAllocThreshold
5163
? stackalloc uint[
BigIntegerCalculator
.StackAllocThreshold]
5188
BigIntegerCalculator
.RightShiftSelf(zd, smallShift, out _);
System\Numerics\BigIntegerCalculator.SquMul.cs (5)
723
BigIntegerCalculator
.Square(p0, r0);
724
BigIntegerCalculator
.Square(p1, r1);
725
BigIntegerCalculator
.Square(pm1, rm1);
726
BigIntegerCalculator
.Square(pm2, rm2);
727
BigIntegerCalculator
.Square(pInf, rInf);