156 references to BigIntegerCalculator
System.Runtime.Numerics (156)
System\Number.BigInteger.cs (37)
358base1E9Length <= BigIntegerCalculator.StackAllocThreshold 359? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 384resultLength <= BigIntegerCalculator.StackAllocThreshold 385? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 417(uint)powersOf1e9BufferLength <= BigIntegerCalculator.StackAllocThreshold 418? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 429leadingLength <= BigIntegerCalculator.StackAllocThreshold 430? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 435leading = leading.Slice(0, BigIntegerCalculator.ActualLength(leading)); 456base1E9 = base1E9.Slice(0, BigIntegerCalculator.ActualLength(base1E9)); 476bufferLength <= BigIntegerCalculator.StackAllocThreshold 477? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 483ReadOnlySpan<uint> buffer2 = buffer.Slice(0, BigIntegerCalculator.ActualLength(buffer)); 486BigIntegerCalculator.Multiply(buffer2, multiplier, bitsUpper); 488BigIntegerCalculator.Multiply(multiplier, buffer2, bitsUpper); 494BigIntegerCalculator.AddSelf(bits, buffer.Slice(0, BigIntegerCalculator.ActualLength(buffer))); 820Span<uint> base1E9Buffer = ((uint)base1E9BufferLength <= BigIntegerCalculator.StackAllocThreshold ? 976int ToStringNaiveThreshold = BigIntegerCalculator.DivideBurnikelZieglerThreshold; 990powersOf1e9BufferLength <= BigIntegerCalculator.StackAllocThreshold 991? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1018while (bits.Length < powOfTen.Length + omittedLength || BigIntegerCalculator.Compare(bits.Slice(omittedLength), powOfTen) < 0) 1027Span<uint> upper = ((uint)upperLength <= BigIntegerCalculator.StackAllocThreshold 1028? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1033Span<uint> lower = ((uint)lowerLength <= BigIntegerCalculator.StackAllocThreshold 1034? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1038BigIntegerCalculator.Divide(bits.Slice(omittedLength), powOfTen, upper, lower.Slice(omittedLength)); 1047lower.Slice(0, BigIntegerCalculator.ActualLength(lower)), 1059upper.Slice(0, BigIntegerCalculator.ActualLength(upper)), 1232BigIntegerCalculator.Square(src, dst); 1300BigIntegerCalculator.Multiply(left, UInt32PowersOfTen[trailingZeroCount], bits.Slice(0, left.Length + 1)); 1307bits.Length <= BigIntegerCalculator.StackAllocThreshold 1308? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1344BigIntegerCalculator.Multiply(src, power, dst); 1346BigIntegerCalculator.Multiply(power, src, dst); 1364BigIntegerCalculator.Multiply(powersOfTen, left, bits2); 1366BigIntegerCalculator.Multiply(left, powersOfTen, bits2);
System\Numerics\BigInteger.cs (119)
797Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 798? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 804BigIntegerCalculator.Divide(dividend._bits, NumericsHelpers.Abs(divisor._sign), quotient, out rest); 827Span<uint> rest = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 828? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 833Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 834? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 837BigIntegerCalculator.Divide(dividend._bits, divisor._bits, quotient, rest); 904return 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)) 925if (BigIntegerCalculator.Compare(left._bits, right._bits) < 0) 937Debug.Assert(BigIntegerCalculator.Compare(leftBits, rightBits) >= 0); 945uint temp = BigIntegerCalculator.Remainder(leftBits, rightBits[0]); 946result = BigIntegerCalculator.Gcd(rightBits[0], temp); 950Span<uint> bits = (leftBits.Length <= BigIntegerCalculator.StackAllocThreshold 951? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 954BigIntegerCalculator.Remainder(leftBits, rightBits, bits); 959result = BigIntegerCalculator.Gcd(left, right); 963Span<uint> bits = (leftBits.Length <= BigIntegerCalculator.StackAllocThreshold 964? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 967BigIntegerCalculator.Gcd(leftBits, rightBits, bits); 1007uint bits = trivialValue && trivialExponent ? BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), NumericsHelpers.Abs(exponent._sign), NumericsHelpers.Abs(modulus._sign)) : 1008trivialValue ? BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), exponent._bits!, NumericsHelpers.Abs(modulus._sign)) : 1009trivialExponent ? BigIntegerCalculator.Pow(value._bits!, NumericsHelpers.Abs(exponent._sign), NumericsHelpers.Abs(modulus._sign)) : 1010BigIntegerCalculator.Pow(value._bits!, exponent._bits!, NumericsHelpers.Abs(modulus._sign)); 1018Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1019? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1026BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), NumericsHelpers.Abs(exponent._sign), modulus._bits!, bits); 1030BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), exponent._bits!, modulus._bits!, bits); 1035BigIntegerCalculator.Pow(value._bits!, NumericsHelpers.Abs(exponent._sign), modulus._bits!, bits); 1039BigIntegerCalculator.Pow(value._bits!, exponent._bits!, modulus._bits!, bits); 1077int size = BigIntegerCalculator.PowBound(power, 1); 1078Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1079? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1083BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), power, bits); 1088int size = BigIntegerCalculator.PowBound(power, value._bits!.Length); 1089Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1090? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1094BigIntegerCalculator.Pow(value._bits, power, bits); 1220int bitsResult = BigIntegerCalculator.Compare(_bits, other._bits); 1711Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1712? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1715BigIntegerCalculator.Add(rightBits, NumericsHelpers.Abs(leftSign), bits); 1723Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1724? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1727BigIntegerCalculator.Add(leftBits, NumericsHelpers.Abs(rightSign), bits); 1735Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1736? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1739BigIntegerCalculator.Add(rightBits, leftBits, bits); 1747Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1748? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1751BigIntegerCalculator.Add(leftBits, rightBits, bits); 1789Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1790? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1793BigIntegerCalculator.Subtract(rightBits, NumericsHelpers.Abs(leftSign), bits); 1801Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1802? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1805BigIntegerCalculator.Subtract(leftBits, NumericsHelpers.Abs(rightSign), bits); 1808else if (BigIntegerCalculator.Compare(leftBits, rightBits) < 0) 1811Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1812? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1815BigIntegerCalculator.Subtract(rightBits, leftBits, bits); 1823Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1824? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1827BigIntegerCalculator.Subtract(leftBits, rightBits, bits); 2416Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2417? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2423Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2424? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2430Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2431? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2472Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2473? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2479Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2480? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2486Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2487? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2523Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2524? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2530Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2531? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2537Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2538? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2604BigIntegerCalculator.LeftShiftSelf(zd, smallShift, out uint carry); 2680Span<uint> zd = ((uint)zLength <= BigIntegerCalculator.StackAllocThreshold 2681? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2687BigIntegerCalculator.RightShiftSelf(zd, smallShift, out uint carry); 2774Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2775? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2778BigIntegerCalculator.Multiply(right, NumericsHelpers.Abs(leftSign), bits); 2786Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2787? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2790BigIntegerCalculator.Multiply(left, NumericsHelpers.Abs(rightSign), bits); 2796Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2797? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2800BigIntegerCalculator.Square(left, bits); 2808Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2809? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2813BigIntegerCalculator.Multiply(right, left, bits); 2821Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2822? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2826BigIntegerCalculator.Multiply(left, right, bits); 2863Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2864? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2870BigIntegerCalculator.Divide(dividend._bits, NumericsHelpers.Abs(divisor._sign), quotient); 2889Span<uint> quotient = ((uint)size < BigIntegerCalculator.StackAllocThreshold 2890? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2893BigIntegerCalculator.Divide(dividend._bits, divisor._bits, quotient); 2926uint remainder = BigIntegerCalculator.Remainder(dividend._bits, NumericsHelpers.Abs(divisor._sign)); 2939Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 2940? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2943BigIntegerCalculator.Remainder(dividend._bits, divisor._bits, bits); 3336Span<uint> zd = ((uint)zLength <= BigIntegerCalculator.StackAllocThreshold 3337? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 3353BigIntegerCalculator.RotateLeft(zd, rotateLeftAmount); 5174Span<uint> zd = ((uint)zLength <= BigIntegerCalculator.StackAllocThreshold 5175? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 5200BigIntegerCalculator.RightShiftSelf(zd, smallShift, out _);