156 references to BigIntegerCalculator
System.Runtime.Numerics (156)
System\Number.BigInteger.cs (37)
356base1E9Length <= BigIntegerCalculator.StackAllocThreshold 357? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 382resultLength <= BigIntegerCalculator.StackAllocThreshold 383? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 415(uint)powersOf1e9BufferLength <= BigIntegerCalculator.StackAllocThreshold 416? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 427leadingLength <= BigIntegerCalculator.StackAllocThreshold 428? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 433leading = leading.Slice(0, BigIntegerCalculator.ActualLength(leading)); 454base1E9 = base1E9.Slice(0, BigIntegerCalculator.ActualLength(base1E9)); 474bufferLength <= BigIntegerCalculator.StackAllocThreshold 475? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 481ReadOnlySpan<uint> buffer2 = buffer.Slice(0, BigIntegerCalculator.ActualLength(buffer)); 484BigIntegerCalculator.Multiply(buffer2, multiplier, bitsUpper); 486BigIntegerCalculator.Multiply(multiplier, buffer2, bitsUpper); 492BigIntegerCalculator.AddSelf(bits, buffer.Slice(0, BigIntegerCalculator.ActualLength(buffer))); 809Span<uint> base1E9Buffer = ((uint)base1E9BufferLength <= BigIntegerCalculator.StackAllocThreshold ? 939int ToStringNaiveThreshold = BigIntegerCalculator.DivideBurnikelZieglerThreshold; 953powersOf1e9BufferLength <= BigIntegerCalculator.StackAllocThreshold 954? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 981while (bits.Length < powOfTen.Length + omittedLength || BigIntegerCalculator.Compare(bits.Slice(omittedLength), powOfTen) < 0) 990Span<uint> upper = ((uint)upperLength <= BigIntegerCalculator.StackAllocThreshold 991? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 996Span<uint> lower = ((uint)lowerLength <= BigIntegerCalculator.StackAllocThreshold 997? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1001BigIntegerCalculator.Divide(bits.Slice(omittedLength), powOfTen, upper, lower.Slice(omittedLength)); 1010lower.Slice(0, BigIntegerCalculator.ActualLength(lower)), 1022upper.Slice(0, BigIntegerCalculator.ActualLength(upper)), 1195BigIntegerCalculator.Square(src, dst); 1263BigIntegerCalculator.Multiply(left, UInt32PowersOfTen[trailingZeroCount], bits.Slice(0, left.Length + 1)); 1270bits.Length <= BigIntegerCalculator.StackAllocThreshold 1271? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1307BigIntegerCalculator.Multiply(src, power, dst); 1309BigIntegerCalculator.Multiply(power, src, dst); 1327BigIntegerCalculator.Multiply(powersOfTen, left, bits2); 1329BigIntegerCalculator.Multiply(left, powersOfTen, bits2);
System\Numerics\BigInteger.cs (119)
782Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 783? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 789BigIntegerCalculator.Divide(dividend._bits, NumericsHelpers.Abs(divisor._sign), quotient, out rest); 812Span<uint> rest = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 813? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 818Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 819? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 822BigIntegerCalculator.Divide(dividend._bits, divisor._bits, quotient, rest); 889return BigIntegerCalculator.Gcd(NumericsHelpers.Abs(left._sign), NumericsHelpers.Abs(right._sign)); 896? BigIntegerCalculator.Gcd(right._bits, NumericsHelpers.Abs(left._sign)) 904? BigIntegerCalculator.Gcd(left._bits, NumericsHelpers.Abs(right._sign)) 910if (BigIntegerCalculator.Compare(left._bits, right._bits) < 0) 922Debug.Assert(BigIntegerCalculator.Compare(leftBits, rightBits) >= 0); 930uint temp = BigIntegerCalculator.Remainder(leftBits, rightBits[0]); 931result = BigIntegerCalculator.Gcd(rightBits[0], temp); 935Span<uint> bits = (leftBits.Length <= BigIntegerCalculator.StackAllocThreshold 936? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 939BigIntegerCalculator.Remainder(leftBits, rightBits, bits); 944result = BigIntegerCalculator.Gcd(left, right); 948Span<uint> bits = (leftBits.Length <= BigIntegerCalculator.StackAllocThreshold 949? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 952BigIntegerCalculator.Gcd(leftBits, rightBits, bits); 992uint bits = trivialValue && trivialExponent ? BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), NumericsHelpers.Abs(exponent._sign), NumericsHelpers.Abs(modulus._sign)) : 993trivialValue ? BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), exponent._bits!, NumericsHelpers.Abs(modulus._sign)) : 994trivialExponent ? BigIntegerCalculator.Pow(value._bits!, NumericsHelpers.Abs(exponent._sign), NumericsHelpers.Abs(modulus._sign)) : 995BigIntegerCalculator.Pow(value._bits!, exponent._bits!, NumericsHelpers.Abs(modulus._sign)); 1003Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1004? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1011BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), NumericsHelpers.Abs(exponent._sign), modulus._bits!, bits); 1015BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), exponent._bits!, modulus._bits!, bits); 1020BigIntegerCalculator.Pow(value._bits!, NumericsHelpers.Abs(exponent._sign), modulus._bits!, bits); 1024BigIntegerCalculator.Pow(value._bits!, exponent._bits!, modulus._bits!, bits); 1062int size = BigIntegerCalculator.PowBound(power, 1); 1063Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1064? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1068BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), power, bits); 1073int size = BigIntegerCalculator.PowBound(power, value._bits!.Length); 1074Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1075? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1079BigIntegerCalculator.Pow(value._bits, power, bits); 1205int bitsResult = BigIntegerCalculator.Compare(_bits, other._bits); 1691Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1692? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1695BigIntegerCalculator.Add(rightBits, NumericsHelpers.Abs(leftSign), bits); 1703Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1704? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1707BigIntegerCalculator.Add(leftBits, NumericsHelpers.Abs(rightSign), bits); 1715Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1716? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1719BigIntegerCalculator.Add(rightBits, leftBits, bits); 1727Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1728? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1731BigIntegerCalculator.Add(leftBits, rightBits, bits); 1769Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1770? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1773BigIntegerCalculator.Subtract(rightBits, NumericsHelpers.Abs(leftSign), bits); 1781Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1782? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1785BigIntegerCalculator.Subtract(leftBits, NumericsHelpers.Abs(rightSign), bits); 1788else if (BigIntegerCalculator.Compare(leftBits, rightBits) < 0) 1791Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1792? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1795BigIntegerCalculator.Subtract(rightBits, leftBits, bits); 1803Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1804? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1807BigIntegerCalculator.Subtract(leftBits, rightBits, bits); 2380Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2381? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2387Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2388? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2394Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2395? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2436Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2437? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2443Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2444? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2450Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2451? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2487Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2488? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2494Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2495? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2501Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2502? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2568BigIntegerCalculator.LeftShiftSelf(zd, smallShift, out uint carry); 2644Span<uint> zd = ((uint)zLength <= BigIntegerCalculator.StackAllocThreshold 2645? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2651BigIntegerCalculator.RightShiftSelf(zd, smallShift, out uint carry); 2738Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2739? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2742BigIntegerCalculator.Multiply(right, NumericsHelpers.Abs(leftSign), bits); 2750Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2751? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2754BigIntegerCalculator.Multiply(left, NumericsHelpers.Abs(rightSign), bits); 2760Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2761? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2764BigIntegerCalculator.Square(left, bits); 2772Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2773? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2777BigIntegerCalculator.Multiply(right, left, bits); 2785Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2786? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2790BigIntegerCalculator.Multiply(left, right, bits); 2827Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2828? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2834BigIntegerCalculator.Divide(dividend._bits, NumericsHelpers.Abs(divisor._sign), quotient); 2853Span<uint> quotient = ((uint)size < BigIntegerCalculator.StackAllocThreshold 2854? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2857BigIntegerCalculator.Divide(dividend._bits, divisor._bits, quotient); 2890uint remainder = BigIntegerCalculator.Remainder(dividend._bits, NumericsHelpers.Abs(divisor._sign)); 2903Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 2904? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2907BigIntegerCalculator.Remainder(dividend._bits, divisor._bits, bits); 3300Span<uint> zd = ((uint)zLength <= BigIntegerCalculator.StackAllocThreshold 3301? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 3317BigIntegerCalculator.RotateLeft(zd, rotateLeftAmount); 5102Span<uint> zd = ((uint)zLength <= BigIntegerCalculator.StackAllocThreshold 5103? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 5128BigIntegerCalculator.RightShiftSelf(zd, smallShift, out _);